home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 3420A.ZIP / TW150L.ZIP / TSDDEMO.PRG < prev    next >
Text File  |  1992-05-11  |  125KB  |  2,709 lines

  1. //┌──────────────────────────────────────────────────────────────────────────┐
  2. //│                                                                          │
  3. //│                            TSDDEMO.PRG                                   │
  4. //│                                                                          │
  5. //│                  Shareware Demonstration Program                         │
  6. //│                   Clipper 5.0 Interface Library                          │
  7. //│                                                                          │
  8. //│      Copyright ( C ) 1992 by Trilateral Systems Development Ltd.         │
  9. //│    All Rights Reserved * Version 1.50 * Release Date: May 1, 1992        │
  10. //│                                                                          │
  11. //│                         18  Bond St. South                               │
  12. //│                         Dundas, ON, Canada                               │
  13. //│                              L9H 3H1                                     │
  14. //│                           416-628-5086                                   │
  15. //│                                                                          │
  16. //│                                                                          │
  17. //│     Documented: 04-18-92      at 09:53:52am                              │
  18. //└──────────────────────────────────────────────────────────────────────────┘
  19. #include "twinkey.ch"
  20. #include "tsdwin.ch"
  21. #include "tsddemo.ch"
  22. #include "getexit.ch"
  23.  
  24. #define K_UNDO          K_CTRL_U
  25.  
  26. STATIC lMono := .F., lOKMouse := .F.
  27. //┌──────────────────────────────────────────────────────────────────────────┐
  28. //│  Description: Main Menu for TSDDEMO                                      │
  29. //│       Author: Vic Lewis                                                  │
  30. //│ Date created: 04-18-92                                                   │
  31. //│ Time created: 09:56:06am                                                 │
  32. //│    Copyright: Trilateral Systems Development Ltd.                        │
  33. //├──────────────────────────────────────────────────────────────────────────┤
  34. //│     Function: Main                                                       │
  35. //│                                                                          │
  36. //│    Arguments: cCmdLine (/THIN /M /50 /?)                                 │
  37. //│                                                                          │
  38. //│ Return Value: NIL                                                        │
  39. //│                                                                          │
  40. //└──────────────────────────────────────────────────────────────────────────┘
  41. FUNCTION Main( cCmdLine )
  42. LOCAL nChoice := 1, nStartRow, nStartCol, nX, lExitRequested := .F.
  43. LOCAL aMenu := {}, nExit, nThickness := 2, cClrTemp, aArea :=  { 24, 24 }
  44. LOCAL aPrompts := { " «1.» TSDWIN Highlights  ",;
  45.                     " «2.» Window Functions   ",;
  46.                     " «3.» Message Functions  ",;
  47.                     " «4.» Menu Functions     ",;
  48.                     " «5.» Browse Systems     ",;
  49.                     " «6.» Mouse Support      ",;
  50.                     " «7.» Miscellaneous      ",;
  51.                     " «8.» Hardware Functions ",;
  52.                     " «9.» Placing an Order   ",;
  53.                     " «Q.» End the Demo       " }
  54.  
  55. //┌──────────────────────────────────────────────────────────────────────────
  56. //│ Set Up Environment
  57. //└──────────────────────────────────────────────────────────────────────────
  58. SET CURSOR OFF
  59. SET SCOREBOARD OFF
  60. SET WRAP ON
  61.  
  62. //┌──────────────────────────────────────────────────────────────────────────
  63. //│ Link in the Screen Savers
  64. //└──────────────────────────────────────────────────────────────────────────
  65. EXTERNAL twSSaveAsc
  66. EXTERNAL twWSaveAsc
  67. SET KEY 287 TO twSSaveAsc
  68. SET KEY 273 TO twWSaveAsc
  69.  
  70. //┌──────────────────────────────────────────────────────────────────────────
  71. //│ Parse the command line
  72. //└──────────────────────────────────────────────────────────────────────────
  73. lMono := IIF( ISCOLOR(), .F. , .T. )
  74. IF cCmdLine != NIL
  75.     IF "/THIN" $ UPPER( cCmdLine )
  76.         nThickness := 1
  77.     ENDIF
  78.     IF "/M" $ UPPER( cCmdLine )
  79.         lMono := .T.
  80.     ENDIF
  81.     IF "/50" $ UPPER( cCmdLine )
  82.         aArea := { 49, 49 }
  83.         SETMODE( 50, 80 )
  84.     ENDIF
  85.     IF "/?" $ cCmdLine
  86.         cClrTemp := SETCOLOR( IIF( ISCOLOR(), "gr+/n", "w+/n" ))
  87.         QOUT( "         Usage: TSDDEMO <options>" )
  88.         QOUT( "" )
  89.         SETCOLOR( IIF( ISCOLOR(), "bg+/n", "w+/n" ))
  90.         QOUT( "     Options: '/THIN' for Thin Shadows." )
  91.         QOUT( "              '/M' for Monochrome" )
  92.         QOUT( "              '/50' for VGA Mode" )
  93.         SETCOLOR( IIF( ISCOLOR(), "rb+/n", "w+/n" ))
  94.         QOUT( "" )
  95.         QOUT( "              TSDWIN.LIB " )
  96.         QOUT( "     Clipper 5.01 Interface Library" )
  97.         QOUT( "   Trilateral Systems Development Ltd." )
  98.         QOUT( "             416-628-5086" );QOUT( "" );QOUT( "" )
  99.         SETCOLOR( cClrTemp )
  100.         RETURN NIL
  101.     ENDIF
  102. ENDIF
  103.  
  104. //┌──────────────────────────────────────────────────────────────────────────
  105. //│ Initialize windows to thick or thin shadows
  106. //│ and allow for Monchrome Override if Graphics card installed
  107. //│ Save environment and DOS screen
  108. //└──────────────────────────────────────────────────────────────────────────
  109. twInit( nThickness )
  110. twOpen()
  111.  
  112. //┌──────────────────────────────────────────────────────────────────────────
  113. //│ Initialize the Mouse
  114. //└──────────────────────────────────────────────────────────────────────────
  115. lOKMouse := twMouseInit()
  116.  
  117. //┌──────────────────────────────────────────────────────────────────────────
  118. //│ Initialize TSDWIN 'meta' variables from the header file.
  119. //└──────────────────────────────────────────────────────────────────────────
  120. INITGLOBALS
  121.  
  122. //┌──────────────────────────────────────────────────────────────────────────
  123. //│ Initialize TSDWIN Message Systems
  124. //└──────────────────────────────────────────────────────────────────────────
  125. twAlertInit( , { { CBUTTON, CFBUTTON }, ;
  126.                  { CCHECK,  CFCHECK }, ;
  127.                  { CRADIO,  CFRADIO } } ) // Alert Initialization
  128. twAMsgInit(  , { COLORW, COLORN }, aArea )  // Area Message Initialization
  129. twMsgInit(   , { { COLORE, TCOLOR },;
  130.                  { COLORW, TCOLOR },;
  131.                  { COLORM, TCOLOR },;
  132.                  { COLORW, TCOLOR },;
  133.                  { COLORW, TCOLOR } })      // Messages
  134.  
  135. //┌──────────────────────────────────────────────────────────────────────────
  136. //│ Begin Main Menu
  137. //└──────────────────────────────────────────────────────────────────────────
  138. SETCOLOR( IIF( ! lMono, "n/bg", "n/w" ))
  139. twExplode( .T. )
  140. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  141.  
  142. twExplode( DEXPLODE )
  143. SETBLINK( DBLINK )
  144. twInfoLine( -2, "TSDWIN Interface Library for Clipper 5.01", "C", 0 )
  145. twInfoLine( -2, "«T»rilateral «S»ystems «D»evelopment Ltd.", "C" )
  146. TSDSetup( lMono )
  147.  
  148. nStartRow := 2;nStartCol := 2
  149.  
  150. FOR nX := 1 TO 10
  151.     twCreateButton( nStartRow, nStartCol, SPACE( 21 ), .T.,, DSHADOW );nStartRow += 2
  152. NEXT
  153.  
  154. twAttrib( .F., "n/w",  2, 28, 20, 75 )
  155. twBox( 2, 28, 20, 75, 1, "n/w" )
  156. twReplicate( 21, 29, "▀", 48, IIF( ! lMono, "n/b", "n/w" ))
  157. @ twRow( 2 ), twCol( 76 ) SAY "▄" COLOR IIF( ! lMono, "n/b", "n/w" )
  158. FOR nX = 1 TO 18
  159.     @ twRow( nX + 2 ), twCol( 76 ) SAY "█" COLOR "n/n"
  160. NEXT
  161.  
  162. DO WHILE .T.
  163.     nStartRow := 2;nStartCol := 2
  164.     twMenuInit( 2, twRow( 3 ), twCol( 30 ), IIF( ! lMono, "n/w,r/w", "n/w,w+/n" ), .T. )
  165.     FOR nX := 1 TO 10
  166.         //@ nStartRow, nStartCol WPROMPT aPrompts[ nX ] MESSAGE aMessages[ nX ] COLOR MENUCLR ;nStartRow += 2
  167.         @ nStartRow, nStartCol WPROMPT aPrompts[ nX ] MESSAGE StoreDesc( nX ) COLOR MENUCLR ;nStartRow += 2
  168.     NEXT
  169.  
  170.     WMENU TO nChoice
  171.  
  172.     DO CASE
  173.         CASE nChoice = 1;TSD10000()
  174.         CASE nChoice = 2;TSD20000()
  175.         CASE nChoice = 3;TSD30000()
  176.         CASE nChoice = 4;TSD40000()
  177.         CASE nChoice = 5;TSD50000()
  178.         CASE nChoice = 6;TSD60000()
  179.         CASE nChoice = 7;TSD70000()
  180.         CASE nChoice = 8;TSD80000()
  181.         CASE nChoice = 9;TSD90000()
  182.         CASE nChoice = 10 .OR. nChoice = 0 .OR. LASTKEY() = K_ESC
  183.             nExit := AskUser({ "Yes, I'm Finished", "No, Resume the Demo" },;
  184.                      "Are you sure you've seen enough?" )
  185.             IF nExit != 2
  186.                 EXIT
  187.             ELSE
  188.                 nChoice := 1
  189.             ENDIF
  190.     ENDCASE
  191.  
  192. ENDDO
  193. twAMPop();twAMPop()
  194. twPop();twPop()
  195. SETMODE( 25, 80 )
  196. CLS
  197. RETURN NIL
  198.  
  199. //┌──────────────────────────────────────────────────────────────────────────┐
  200. //│  Description: TSDWIN Highlights (Quick Reference File)                   │
  201. //│       Author: Vic Lewis                                                  │
  202. //│ Date created: 04-18-92                                                   │
  203. //│ Time created: 12:40:07pm                                                 │
  204. //│    Copyright: Trilateral Systems Development Ltd.                        │
  205. //├──────────────────────────────────────────────────────────────────────────┤
  206. //│     Function: TSD10000()                                                 │
  207. //│                                                                          │
  208. //│    Arguments: None.                                                      │
  209. //│                                                                          │
  210. //│ Return Value: NIL                                                        │
  211. //│                                                                          │
  212. //└──────────────────────────────────────────────────────────────────────────┘
  213. FUNCTION TSD10000()
  214. twTextFile( FULLSCREEN, "TSWINQRF.DOC", COLORN, ;
  215.            0, DFRAME, COLORFN,, ;
  216.            {|| twTitle( "TSDWIN Quick Reference", "n/w" )})
  217. RETURN NIL
  218.  
  219. //┌──────────────────────────────────────────────────────────────────────────┐
  220. //│  Description: Basic Window Operations                                    │
  221. //│       Author: Vic Lewis                                                  │
  222. //│ Date created: 04-18-92                                                   │
  223. //│ Time created: 12:54:26pm                                                 │
  224. //│    Copyright: Trilateral Systems Development Ltd.                        │
  225. //├──────────────────────────────────────────────────────────────────────────┤
  226. //│     Function: TSD20000                                                   │
  227. //│                                                                          │
  228. //│    Arguments: None.                                                      │
  229. //│                                                                          │
  230. //│ Return Value: NIL                                                        │
  231. //│                                                                          │
  232. //└──────────────────────────────────────────────────────────────────────────┘
  233. FUNCTION TSD20000()
  234. LOCAL nWin1, nWin2, nWin3, nWin4, nKey := 0
  235. LOCAL nCol := 14, nRow := 4, nHandle, nX, nType, xTemp
  236. LOCAL aColors := { IIF( ! lMono, "gr+/r" ,"n/w" ),;
  237.                    IIF( ! lMono, "w+/g" ,"w/n" ),;
  238.                    IIF( ! lMono, "n/*gr" ,"w+/n" ),;
  239.                    IIF( ! lMono, "r/w" ,"n/w" ),;
  240.                    IIF( ! lMono, "n/bg" ,"w/n" ),;
  241.                    IIF( ! lMono, "gr+/*b" ,"w+/n" ),;
  242.                    IIF( ! lMono, "w+/r" ,"n/w" ),;
  243.                    IIF( ! lMono, "rb+/n" ,"w/n" ),;
  244.                    IIF( ! lMono, "n/w" ,"w+/n" ),;
  245.                    IIF( ! lMono, "g+/bg" ,"n/w" )}
  246.  
  247. nWin1 := twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME, "", COLORFN )
  248.  
  249. //┌──────────────────────────────────────────────────────────────────────────
  250. //│ Shadowing
  251. //└──────────────────────────────────────────────────────────────────────────
  252. twTitle( PADC( "Window Shadows", 30 ), TCOLOR, "T", "C" )
  253. twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
  254. twOpen( 4, 5, 10, 34, COLORM, 1, DFRAME )
  255. twCenter( 3, "Shadow Type 1" )
  256. twOpen( 4, 45, 10, 74, COLORM, 7, DFRAME )
  257. twCenter( 3, "Shadow Type 7" )
  258. twOpen( 14, 5, 20, 34, COLORM, 9, DFRAME )
  259. twCenter( 3, "Shadow Type 9" )
  260. twOpen( 14, 45, 20, 74, COLORM, 3, DFRAME )
  261. twCenter( 3, "Shadow Type 3" )
  262. twMInkeyWait( 3, .T., .T. )
  263. BEEPER
  264. UserMsg( { "Remember, You Can Change Your", ;
  265.            "Shadow Thickness with twInit()",;
  266.            "    Try 'TSDDEMO /THIN'" }, 3 )
  267. FOR nX = 1 TO 4
  268.     twPop()
  269. NEXT
  270.  
  271. //┌──────────────────────────────────────────────────────────────────────────
  272. //│ Frames
  273. //└──────────────────────────────────────────────────────────────────────────
  274. twTitle( PADC( "Window and Box Borders", 30 ), TCOLOR, "T", "C" )
  275. twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
  276. twCenter( 2, "Windows and Boxes can have 14 different frames." )
  277. //twMInkeyWait( 3, .T., .T. )
  278. FOR  nX = 1 TO 14
  279.     twFrame( nX );twMInkeyWait( .5, .T., .T. )
  280. NEXT
  281. twFrame( DFRAME )
  282. twMInkeyWait( 1, .T., .T. )
  283. BEEPER
  284. twCenter( 4, "You can also vary the frame colour." )
  285. twMInkeyWait( 1, .T., .T. )
  286. twFrame( 2, IIF( !lMono, "gr+/r",  "w/n" ))
  287. twMInkeyWait( 1, .T., .T. )
  288. twFrame( 2, IIF( !lMono, "n/bg",   "n/w" ))
  289. twMInkeyWait( 1, .T., .T. )
  290. twFrame( 2, IIF( !lMono, "w+/*rb", "w+/n" ))
  291. twMInkeyWait( 1, .T., .T. )
  292. twFrame( DFRAME, COLORFM )
  293. BEEPER
  294. twCenter( 6, "You can also specify separate colours to be used" )
  295. twCenter( 7, "to identify ACTIVE and INACTIVE windows!" )
  296. twMInkeyWait( 2, .T., .T. )
  297. UserMsg( "See What I Mean!!",2, 2, 2 )
  298.  
  299. //┌──────────────────────────────────────────────────────────────────────────
  300. //│ Lines
  301. //└──────────────────────────────────────────────────────────────────────────
  302. nHandle := _twHandle( nWin1 )
  303. twTitle( PADC( "Lines and Boxes", 30 ), TCOLOR, "T", "C" )
  304. _twHandle( nHandle )
  305.  
  306. twClear( .F. )
  307. twCenter( 2, "There are a variety of horizontal line options." )
  308.  
  309. FOR nX = 1 TO 11
  310.     nType := PADL( STRINT( nX ), 2 )
  311.     twLeft( nX + 3, "            Type  " + nType + ":" )
  312.     twHLine( nX + 3, 23, 24, nX )
  313. NEXT
  314. twMInkeyWait( 3, .T., .T. )
  315. twClear( .F. )
  316. twCenter( 2, "And vertical lines as well." )
  317. twCenter( 4, "Types")
  318. twCenter( 5, "  1  2  3  4  5  6  7  8  9 10 11 12" )
  319. FOR nX = 1 TO 12
  320.     twVLine( 7, 14 + 3 * ( nX - 1 ), 8, nX )
  321. NEXT
  322. twMInkeyWait( 3, .T., .T. )
  323.  
  324. //┌──────────────────────────────────────────────────────────────────────────
  325. //│ Titles
  326. //└──────────────────────────────────────────────────────────────────────────
  327. nHandle := _twHandle( nWin1 )
  328. twTitle( PADC( "Window Titles", 30 ), TCOLOR, "T", "C" )
  329. _twHandle( nHandle )
  330. twClear( .F.)
  331. twFrame( DFRAME,,, .F. )
  332. twLeft( 3, "  You can center headers." )
  333. twMInkeyWait( 1, .T., .T. )
  334. twTitle( "TSDWIN",, "T", "C" )
  335. twMInkeyWait( 1, .T., .T. )
  336. @ twRow( 3 ), twCol( 27 ) SAY "Or right and left justify them!"
  337. twMInkeyWait( 1, .T., .T. )
  338. twTitle( "Has",, "T", "L" )
  339. twMInkeyWait( 1, .T., .T. )
  340. twTitle( "Windows",, "T", "R" )
  341. twMInkeyWait( 1, .T., .T. )
  342. twCenter( 5, " You can do the same with footers." )
  343. twMInkeyWait( 1, .T., .T. )
  344. twTitle( "Interface Library",, "B", "C" )
  345. twMInkeyWait( 1, .T., .T. )
  346. twTitle( "For",, "B", "L" )
  347. twMInkeyWait( 1, .T., .T. )
  348. twTitle( "You",, "B", "R" )
  349. twMInkeyWait( 1, .T., .T. )
  350. twCenter( 7, " You can even choose their colour!" )
  351. twTitle( "TSDWIN", aColors[1], "T", "C" )
  352. twTitle( "Has", aColors[2], "T", "L" )
  353. twTitle( "Windows", aColors[3], "T", "R" )
  354. twTitle( "Interface Library", aColors[4], "B", "C" )
  355. twTitle( "For", aColors[5], "B", "L" )
  356. twTitle( "You", aColors[6], "B", "R" )
  357. twMInkeyWait( 1, .T., .T. )
  358. FOR nX = 1 TO 5
  359.     twTitle( "Has", aColors[1], "T", "L" )
  360.     twTitle( "TSDWIN", aColors[2], "T", "C" )
  361.     twTitle( "Windows", aColors[3], "T", "R" )
  362.     twTitle( "You", aColors[4], "B", "R" )
  363.     twTitle( "Interface Library", aColors[5], "B", "C" )
  364.     twTitle( "For", aColors[6], "B", "L" )
  365.     xTemp := aColors[1]
  366.     ADEL( aColors, 1 )
  367.     aColors[6] := xTemp
  368. NEXT
  369. twMInkeyWait( 2, .T., .T. )
  370. twCenter( 9, "Delimiters can be inserted." )
  371. twMInkeyWait( 2, .T., .T. )
  372. FOR nX = 1 TO 5
  373.     twTitle( "Has", aColors[1], "T", "L", "[]" )
  374.     twTitle( "TSDWIN", aColors[2], "T", "C", "" )
  375.     twTitle( "Windows", aColors[3], "T", "R", "**" )
  376.     twTitle( "You", aColors[4], "B", "R", "╣╠" )
  377.     twTitle( "Interface Library", aColors[5], "B", "C", "││" )
  378.     twTitle( "For", aColors[6], "B", "L", "╡╞" )
  379.     xTemp := aColors[1]
  380.     ADEL( aColors, 1 )
  381.     aColors[6] := xTemp
  382. NEXT
  383. twMInkeyWait( 4, .T., .T. )
  384. twFrame( DFRAME,,, .F. )
  385.  
  386. //┌──────────────────────────────────────────────────────────────────────────
  387. //│ Text Formatting
  388. //└──────────────────────────────────────────────────────────────────────────
  389. nHandle := _twHandle( nWin1 )
  390. twTitle( PADC( "Text Formatting", 30 ), TCOLOR, "T", "C" )
  391. _twHandle( nHandle )
  392. twClear( .F. )
  393. twLeft( 2, "It's easy to left justify text." )
  394. twMInkeyWait( .5, .T., .T. )
  395. twCenter( 4, "And center it too!" )
  396. twMInkeyWait( .5, .T., .T. )
  397. twRight( 6, "You can right justify, of Course." )
  398. twMInkeyWait( .5, .T., .T. )
  399. twLeft( 8, " You can replicate any character." )
  400. twMInkeyWait( .5, .T., .T. )
  401. twReplicate( 8, 35, "■", 24 )
  402. twMInkeyWait( .5, .T., .T. )
  403. twCenter( 10, "You can also:" )
  404. twMInkeyWait( .5, .T., .T. )
  405. twSay( 12, 10 + 4, "PUT" )
  406. twMInkeyWait( .1, .T., .T. )
  407. twSay( 13, 12 + 4, "TEXT" )
  408. twMInkeyWait( .1, .T., .T. )
  409. twSay( 14, 14 + 4, "ANYWHERE" )
  410. twMInkeyWait( .1, .T., .T. )
  411. twSay( 15, 12 + 4, "YOU" )
  412. twMInkeyWait( .1, .T., .T. )
  413. twSay( 16, 10 + 4, "WANT" )
  414. twMInkeyWait( 1, .T., .T. )
  415. twSay( 12, 46 - 5, " In ", aColors[1] )
  416. twMInkeyWait( .1, .T., .T. )
  417. twSay( 13, 44 - 5, " Any ", aColors[2] )
  418. twMInkeyWait( .1, .T., .T. )
  419. twSay( 14, 42 - 5, " Colour ", aColors[3] )
  420. twMInkeyWait( .1, .T., .T. )
  421. twSay( 15, 44 - 5, " You ", aColors[4] )
  422. twMInkeyWait( .1, .T., .T. )
  423. twSay( 16, 46 - 5, " Want ", aColors[5] )
  424. twMInkeyWait( 1, .T., .T. )
  425. twScroll( 2, .F. )
  426.  
  427. twType( 16, 10, "You can emulate a typewriter if you want.",, .T. )
  428. twType( 17, 11, " And you can turn off the sound, too! ", aColors[ 3 ], .F. )
  429. twScroll( 2, .F. )
  430. twType( 17, 17, "Scrolling your screen  can",, .F. )
  431. twScroll( 1, .F. )
  432. twType( 17, 17, "make your application look",, .F. )
  433. twScroll( 1, .F. )
  434. twType( 17, 17, "neat. With TSDWIN Ver 1.50",, .F. )
  435. twScroll( 1, .F. )
  436. twType( 17, 17, "Library you can scroll all",, .F. )
  437. twScroll( 1, .F. )
  438. twType( 17, 17, "or part of a window,  with",, .F. )
  439. twScroll( 1, .F. )
  440. twType( 17, 17, "or without the border.    ",, .F. )
  441. FOR nX = 1 TO 17
  442.     twScroll( , .F. )
  443.     twInkeyWait( .1 )
  444. NEXT
  445. twCenter( 2, "Neat Tricks are Easy to Perform" )
  446. twBox( 5, 4, 15, 27, 1, BLA_CYH )
  447. twShadow( 5, 4, 15, 27, 1 )
  448. twBox( 5, 33, 15, 56, 1, BLA_CYH )
  449. twShadow( 5, 33, 15, 56, 3 )
  450. nX := 1
  451. DO WHILE nX <= 6
  452.     twSay( 6, 05, " Use Your Imagination ", YEL_RDH )
  453.     twSay( 14, 34, " Use Your Imagination ", YEL_RDH )
  454.     twInkeyWait( .1 )
  455.     twScroll( -1, .F., 6, 5, 14, 26 )
  456.     twScroll( 1, .F., 6, 34, 14, 55 )
  457.     twInkeyWait( .1 )
  458.     twSay( 6, 05, " **  Have a  Ball  ** ", BLA_GNH )
  459.     twSay( 14, 34, " **  Have a  Ball  ** ", BLA_GNH )
  460.     twInkeyWait( .1 )
  461.     twScroll( -1, .F., 6, 5, 14, 26 )
  462.     twScroll( 1, .F., 6, 34, 14, 55 )
  463.     twInkeyWait( .1 )
  464.     twSay( 6, 05, " CLIPPERING is a joy, ", WHH_BLH )
  465.     twSay( 14, 34, " CLIPPERING is a joy, ", WHH_BLH )
  466.     twInkeyWait( .1 )
  467.     twScroll( -1, .F., 6, 5, 14, 26 )
  468.     twScroll( 1, .F., 6, 34, 14, 55 )
  469.     twInkeyWait( .1 )
  470.     twSay( 6, 05, " with  TSD's  Windows ", RDH_YLH )
  471.     twSay( 14, 34, " with  TSD's  Windows ", RDH_YLH )
  472.     twInkeyWait( .1 )
  473.     twScroll( -1, .F., 6, 5, 14, 26 )
  474.     twScroll( 1, .F., 6, 34, 14, 55 )
  475.     twInkeyWait( .1 )
  476.     nX++
  477. ENDDO
  478. twSay( 6, 05, " **Happy Clippering** ", WHH_VIH )
  479. twSay( 14, 34, " **Happy Clippering** ", WHH_VIH )
  480. twMInkeyWait( 2, .T., .T. )
  481. twScroll( 22, .T. )
  482. twMInkeyWait( .5, .T., .T. )
  483. twPop()
  484.  
  485. //┌──────────────────────────────────────────────────────────────────────────
  486. //│ Boxes
  487. //└──────────────────────────────────────────────────────────────────────────
  488. twTitle( PADC( "Boxes with Shadows", 30 ), TCOLOR, "T", "C" )
  489. twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
  490. twBox( nRow, nCol, nRow + 6, nCol + 20, 1,     BLA_CYH, " " )
  491. twShadow( nRow, nCol, nRow + 6, nCol + 20, 7 )
  492.  
  493. twSay( nRow + 01, nCol + 3, "████████",  RDH_CYH )
  494. twSay( nRow + 02, nCol + 3, "   ██   ",  RDH_CYH )
  495. twSay( nRow + 03, nCol + 3, "   ██   ",  RDH_CYH )
  496. twSay( nRow + 04, nCol + 3, "   ██   ",  RDH_CYH )
  497. twSay( nRow + 05, nCol + 3, "   ██   ",  RDH_CYH )
  498. twSay( nRow + 05, nCol + 9, "RILATERAL", BLU_CYH )
  499.  
  500. twBox( nRow, nCol + 32, nRow + 6, nCol + 52, 1,    BLA_CYH, " " )
  501. twShadow( nRow, nCol + 32, nRow + 6, nCol + 52, 9 )
  502.  
  503. twSay( nRow + 01, nCol + 35, "████████",  YEL_CYH )
  504. twSay( nRow + 02, nCol + 35, "██      ",  YEL_CYH )
  505. twSay( nRow + 03, nCol + 35, "████████",  YEL_CYH )
  506. twSay( nRow + 04, nCol + 35, "      ██",  YEL_CYH )
  507. twSay( nRow + 05, nCol + 35, "████████",  YEL_CYH )
  508. twSay( nRow + 05, nCol + 44, "YSTEMS",    BLU_CYH )
  509.  
  510. twBox( nRow + 9, nCol, nRow + 15, nCol + 24, 1,   BLA_CYH, " " )
  511. twShadow( nRow + 9, nCol, nRow + 15, nCol + 24, 1 )
  512.  
  513. twSay( nRow + 10, nCol + 3, "████████", WHI_CYH )
  514. twSay( nRow + 11, nCol + 3, "██     ▐", WHI_CYH )
  515. twSay( nRow + 12, nCol + 3, "██     ▐", WHI_CYH )
  516. twSay( nRow + 13, nCol + 3, "██     ▐", WHI_CYH )
  517. twSay( nRow + 14, nCol + 3, "████████", WHI_CYH )
  518. twSay( nRow + 14, nCol + 12, "EVELOPMENT", BLU_CYH )
  519.  
  520. twBox( nRow + 9, nCol + 32, nRow + 15, nCol + 52, 1,  BLA_CYH, " " )
  521. twShadow( nRow + 9, nCol + 32, nRow + 15, nCol + 52, 3 )
  522. twSay( nRow + 12, nCol + 39, "Limited",  BLU_CYH )
  523. twMInkeyWait( 1, .T., .T. )
  524. BEEPER
  525.  
  526. twTitle( PADC( "You Can Clear a Box", 30 ), TCOLOR, "T", "C" )
  527. twMInkeyWait( 1, .T., .T. )
  528. twClear( .F., " ", nRow, nCol, nRow + 6, nCol + 20 )
  529. twMInkeyWait( 1, .T., .T. )
  530. BEEPER
  531.  
  532. twTitle( PADC( "Or Include the Border", 30 ), TCOLOR, "T", "C" )
  533. twMInkeyWait( 1, .T., .T. )
  534. twClear( .T., " ", nRow, nCol + 32, nRow + 6, nCol + 52 )
  535. twMInkeyWait( 1, .T., .T. )
  536. BEEPER
  537.  
  538. twTitle( PADC( "And You Can Fill It", 30 ), TCOLOR, "T", "C" )
  539. twMInkeyWait( 1, .T., .T. )
  540. twClear( .T., "▒", nRow + 9, nCol, nRow + 15, nCol + 24 )
  541. twMInkeyWait( 1, .T., .T. )
  542. twClear( .F., "▒", nRow + 9, nCol + 32, nRow + 15, nCol + 52 )
  543. twMInkeyWait( 1, .T., .T. )
  544. BEEPER
  545.  
  546. twTitle( PADC( "You Can Also Change Colours", 30 ), TCOLOR, "T", "C" )
  547. twMInkeyWait( 1, .T., .T. )
  548. twSay( nRow + 11, nCol + 3, "See What" )
  549. twAttrib( .T., YEL_RED, nRow + 9, nCol, nRow + 15, nCol + 24 )
  550. twMInkeyWait( 1, .T., .T. )
  551. twSay( nRow + 11, nCol + 35, "I Mean" )
  552. twAttrib( .F., IIF( ! lMono, "w+/br*", "w+/n" ), nRow + 9, nCol + 32, nRow + 15, nCol + 52 )
  553. twMInkeyWait( 1, .T., .T. )
  554. twAttrib( .F., IIF( ! lMono, "b+/w", "n/w" ))
  555. twMInkeyWait( 1, .T., .T. )
  556. twAttrib( .T., IIF( ! lMono, "gr+/rb", "w+/n" ))
  557. twMInkeyWait( 1, .T., .T. )
  558. twClear( .F. )
  559.  
  560. //┌──────────────────────────────────────────────────────────────────────────
  561. //│ Activation
  562. //└──────────────────────────────────────────────────────────────────────────
  563. twTitle( "Window Activation: USE 'F1', 'F2', 'F3', 'F4', 'ESC to Exit'", TCOLOR, "T", "C" )
  564. twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
  565. nWin1 := twOpen( 02, 00, 12, 39, COLORN, 0, DFRAME,, COLORFN )
  566. twTitle( "Window 1", TCOLOR )
  567. nWin2 := twOpen( 13, 00, 22, 39, COLORE, 0, DFRAME,, COLORFE )
  568. twTitle( "Window 2", TCOLOR, "T", "L" )
  569. nWin3 := twOpen( 02, 40, 12, 79, COLORM, 0, DFRAME,, COLORFM )
  570. twTitle( "Window 3", TCOLOR, "T", "R" )
  571. nWin4 := twOpen( 13, 40, 22, 79, COLORW, 0, DFRAME,, COLORFW )
  572. twTitle( "Window 4", TCOLOR, "B", "L" )
  573.  
  574. DO WHILE nKey != K_ESC
  575.     nKey := twMInkeyWait( 0, .T., .T. )
  576.     DO CASE
  577.         CASE nKey == K_F1
  578.             Window( nWin1 )
  579.         CASE nKey == K_F2
  580.             Window( nWin2 )
  581.         CASE nKey == K_F3
  582.             Window( nWin3 )
  583.         CASE nKey == K_F4
  584.             Window( nWin4 )
  585.     ENDCASE
  586. ENDDO
  587.  
  588. //twActivate( nWin1 )
  589. //twActivate( nWin2 )
  590. //twActivate( nWin3 )
  591. //twActivate( nWin4 )
  592. _twHandle( LEN( _twStack() ))
  593.  
  594. twFrame( DFRAME,,, .F. )
  595. twTitle( "Moving Windows is Easy!", TCOLOR )
  596. twMove( -8, -20 )
  597. twMInkeyWait( 1, .T., .T. )
  598. twPop()
  599.  
  600. twFrame( DFRAME,,, .F. )
  601. twTitle( "I Move Around a Lot!", TCOLOR )
  602. twMove( 8, -20 )
  603. twMInkeyWait( 1, .T., .T. )
  604. twPop()
  605.  
  606. twFrame( DFRAME,,, .F. )
  607. twTitle( "Sliding is Fun!", TCOLOR )
  608. twSlide( "R", 30 );twSlide( "U", 7 );twSlide( "R", 6 );twSlide( "U", 5 )
  609. twSlide( "L", 50 );twSlide( "D", 10 );twSlide( "R", 15 );twSlide( "U", 2 )
  610. twMInkeyWait( 1, .T., .T. )
  611. twPop()
  612.  
  613. twFrame( DFRAME,,, .F. )
  614. twTitle( "Watch me go too!", TCOLOR )
  615. twSlide( "R", 30 );twSlide( "D", 7 );twSlide( "R", 6 );twSlide( "D", 5 )
  616. twSlide( "L", 50 );twSlide( "U", 10 );twSlide( "R", 15 );twSlide( "D", 2 )
  617. twMInkeyWait( 1, .T., .T. )
  618. twPop();twPop()
  619.  
  620. RETURN NIL
  621.  
  622. //┌──────────────────────────────────────────────────────────────────────────┐
  623. //│  Description: Message System Functions                                   │
  624. //│       Author: Vic Lewis                                                  │
  625. //│ Date created: 04-18-92                                                   │
  626. //│ Time created: 09:32:23pm                                                 │
  627. //│    Copyright: Trilateral Systems Development Ltd.                        │
  628. //├──────────────────────────────────────────────────────────────────────────┤
  629. //│     Function: TSD30000                                                   │
  630. //│                                                                          │
  631. //│    Arguments: None.                                                      │
  632. //│                                                                          │
  633. //│ Return Value: NIL                                                        │
  634. //│                                                                          │
  635. //└──────────────────────────────────────────────────────────────────────────┘
  636. FUNCTION TSD30000()
  637. LOCAL lExit := .F., nGetExit
  638. LOCAL nWin1 := twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME, "", COLORFN )
  639. LOCAL aActionKeys :=   {{ 1, { || TSD30001() }},;
  640.                         { 2, { || TSD30002() }},;
  641.                         { 3, { || TSD30003() }},;
  642.                         { 4, { || TSD30004() }}}
  643.  
  644. twTitle( PADC( "TSDWIN Message Systems", 30 ), TCOLOR )
  645. DO WHILE !lExit
  646.  
  647.     nGetExit := twButtonBox( "V", ;
  648.                "Welcome to «TSDWIN»'s Message Systems. "+ ;
  649.                "With «TSDWIN V1.50» looking after the details, you get "+ ;
  650.                "more time to look after the important part of "+ ;
  651.                "your application... «The Data»!", ;
  652.                { "This is a twButtonBox() Acting Like a Menu", TCOLOR },, ;
  653.                { "Alert Messages", ;
  654.                  "Windowed Messages", ;
  655.                  "Line/Area Messages", ;
  656.                  "Mouse Support", ;
  657.                  "Main Menu" },, ;
  658.                5, 5, 17, 74, DSHADOW, DFRAME,, aActionKeys )
  659.  
  660.     IF nGetExit = 5 .OR. nGetExit  =  0
  661.         lExit := .T.
  662.     ENDIF
  663.  
  664. ENDDO
  665. twPop()
  666.  
  667. RETURN NIL
  668.  
  669. //┌──────────────────────────────────────────────────────────────────────────┐
  670. //│  Description: Alert System                                               │
  671. //│       Author: Vic Lewis                                                  │
  672. //│ Date created: 04-19-92                                                   │
  673. //│ Time created: 08:22:09am                                                 │
  674. //│    Copyright: Trilateral Systems Development Ltd.                        │
  675. //├──────────────────────────────────────────────────────────────────────────┤
  676. //│     Function: TSD30001                                                   │
  677. //│                                                                          │
  678. //│    Arguments: None.                                                      │
  679. //│                                                                          │
  680. //│ Return Value: NIL                                                        │
  681. //│                                                                          │
  682. //└──────────────────────────────────────────────────────────────────────────┘
  683. FUNCTION TSD30001()
  684. LOCAL RetVal, cClrTemp
  685. LOCAL AText1 := ;
  686.       "One function is used in TSDWIN to create various types of " + ;
  687.       "alert boxes: PushButton Boxes, Radio Boxes and Select Boxes. " + ;
  688.       "Default buttons are created of none are passed, or, if passed " + ;
  689.       "as an array, buttons are created and displayed. In the case of " + ;
  690.       "PushButtons, they are shadowed with a thin shadow of the same " + ;
  691.       "type as the controlling window. The frame type is the same as " + ;
  692.       "that of the controlling window. The colour for each type of box " + ;
  693.       "defaults to an initial value, but is defineable. Shadow and frame " + ;
  694.       "type are defineable with each function call. The Buttons, or other " + ;
  695.       "select devices may be positioned horizontally or vertically."
  696. LOCAL ATEXT2 := ;
  697.       "The return values are, for twButtonBox() and twRadioBox(), the element " + ;
  698.       "of the array in which the buttons are held. For twCheckBox(), an array " + ;
  699.       "of checked elements is returned. All three of these functions act " + ;
  700.       "like similar constructs in MS-Windows. For the twButtonBox() function, " + ;
  701.       "the default Exit key is the Enter or Escape key. For twCheckBox() and " + ;
  702.       "twRadioBox(), Enter or Space toggles the selection and the Escape key " + ;
  703.       "exits the routine. Only SINGLE choices are allowed with twButtonBox() " + ;
  704.       "and twRadioBox(). Multiple choices are allowed with twCheckBox(). " + ;
  705.       "You may pass either new Exit keys or additonal " + ;
  706.       "Action keys to the function. With this feature, you may use any one " + ;
  707.       "of these functions to present a pop-up menu with very little " + ;
  708.       "code. The menu choice can then be simply the function itself. With " + ;
  709.       "Action keys, you can extend the usefulness of these functions in any " + ;
  710.       "number of ways. More examples will be available on the TSD support " + ;
  711.       "board."
  712. LOCAL AText3 := ;
  713.       "Watch while we demonstrate the same functions called with a vertical " + ;
  714.       "configuration. Remember, all that need be passed is the message text " + ;
  715.       "and an array of choices! We'll show the RETURN values with another " + ;
  716.       "TSDWIN Messaging function twInfo(), after you make a selection."
  717.  
  718. twCheckBox( "H", ;                                // Style
  719.           AText1, ;                             // Message
  720.           {  "twCheckBox() with Custom Features", TCOLOR },, ; // Title ( No Button Number )
  721.           { "Check", "As", "Many", ;            // Button
  722.             "As", "You", "Want" }, ;            //   Array
  723.           2, 3, 5, 18, 74, DSHADOW, DFRAME )               // Start, Coords, Shadow, Frame
  724.  
  725. twRadioBox( "H", ;                                // Style
  726.           AText2, ;                             // Message
  727.           { "This Uses twRadioBox()", TCOLOR },, ;            // Title ( No Button Number )
  728.           { "What's On", "The Radio", ;         // Button
  729.             "Tonight", "Dear" }, ;              //   Array
  730.           3, 2, 3, 21, 76, DSHADOW, DFRAME )               // Start, Coords, Shadow, Frame
  731.  
  732. RetVal := twCheckBox( "V", ;
  733.           AText3, ;
  734.           { "Here's twCheckBox() Vertical", TCOLOR },, ;
  735.           { "Who Says", "You Can", "Only Pick", "One??" }, ;
  736.           1,, 7,, 71, DSHADOW, DFRAME )
  737. CheckRtn( RetVal )
  738.  
  739. RetVal := twRadioBox( "V", ;
  740.           AText3, ;
  741.           { "I Know Why These are Called Radio Boxes!", TCOLOR },, ;
  742.           { "WKRP", "CHFI", "WNYC", "CKFM", "C100", "TSDL" }, ;
  743.           5, 2, 5, 16, 54, DSHADOW, DFRAME )
  744. CheckRtn( RetVal )
  745.  
  746. RetVal := twButtonBox( "V", ;
  747.           AText3 + " Have a look at the DEMO to see how easy " + ;
  748.           "it is to do things like this!", ;
  749.           { "LISTEN HERE!", TCOLOR },, ;
  750.           {"Well Now", ;
  751.            "It's About Time", ;
  752.            "We Got", ;
  753.            "A Few Things Straight, Dont' You?", ;
  754.            "TSDWIN Can", ;
  755.            "Make Your Life Easier", ;
  756.            "And Your Applications", ;
  757.            "More Coherent", ;
  758.            "Have No Doubt About That" }, ;
  759.            5, 2, 5, 22, 73, DSHADOW, DFRAME )
  760. CheckRtn( RetVal )
  761.  
  762. twButtonBox( "H", "Now, wasn't that fun? You have seen some of the best Clipper functions"+;
  763.           " ever made. "+;
  764.           " TSD Ltd. will also be the first to provide Clipper users with a pseudo-object which turns lead into"+;
  765.           " gold, with the correct parameters! The parameter list will be supplied on"+;
  766.           " registration. One of the parameters will trigger a previously undocumented DOS"+;
  767.           " interrupt which starts a process rolling which will ultimately set the lead into gold routine into motion."+;
  768.           " After a suitable processing time, thin sheets of pure gold will start issuing"+;
  769.           " from the access door of the floppy drive designated as 'A' on your machine. "+;
  770.           " TSD recommends you advise your customers to have Brinks on hand when using this function."+;
  771.           " Please be warned that this particular routine may fail with some combinations of hardware."+;
  772.           " This routine has been tested on some types of hardware."+;
  773.           " Consult your hardware dealer for details about your BIOS if it doesn't work for you...", "GOLD! GOLD!! GOLD!!!", ;
  774.           1,,, 2, 5, 22, 75, DSHADOW, DFRAME )
  775.  
  776. RETURN NIL
  777.  
  778. //┌──────────────────────────────────────────────────────────────────────────┐
  779. //│  Description: Message System                                             │
  780. //│       Author: Vic Lewis                                                  │
  781. //│ Date created: 04-19-92                                                   │
  782. //│ Time created: 08:22:09am                                                 │
  783. //│    Copyright: Trilateral Systems Development Ltd.                        │
  784. //├──────────────────────────────────────────────────────────────────────────┤
  785. //│     Function: TSD30002                                                   │
  786. //│                                                                          │
  787. //│    Arguments: None.                                                      │
  788. //│                                                                          │
  789. //│ Return Value: NIL                                                        │
  790. //│                                                                          │
  791. //└──────────────────────────────────────────────────────────────────────────┘
  792. FUNCTION TSD30002()
  793. LOCAL Var2Read := SPACE( 20 ), Var2 := SPACE( 20 )
  794.  
  795. twWarn( " Trying a Warning Message ",,,,, DSHADOW, DFRAME )
  796. twInfo( " Trying an Info Message ",,,,, DSHADOW, DFRAME )
  797. twTextMsg("Trying a Text Message. With this one we have to have the thing do a word"+;
  798.         "wrap to put it into the box.",,,5,5,15,45,, DSHADOW, DFRAME )
  799.  
  800. twInquire( {"Trying out an Inquire Message:",;
  801.            "Let's see if more lines will work out OK too?",;
  802.            "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",;
  803.            "";
  804.            },, Var2Read,,, DSHADOW, DFRAME )
  805.  
  806. twInquire( "Trying out another Inquire Message:","Trying", Var2 )
  807.  
  808. twInfo( {" Trying an Info Message ",;
  809.        "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6",;
  810.        "Item 7", "Item 8", "Item 9", "Item 10", "Item 11", "Item 12" };
  811.        ,,,,, DSHADOW, DFRAME )
  812.  
  813. twMsgInit( 1, IIF( !lMono, "gr+/r,w/n,,,w+/n", "n/w,w+/n,,,w/n"))
  814.  
  815. twInfo( {" You can change colours ",;
  816.        "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7" };
  817.        ,,,,, DSHADOW, DFRAME )
  818.  
  819. twMsgInit( 1, { COLORE, TCOLOR })
  820. RETURN NIL
  821.  
  822. //┌──────────────────────────────────────────────────────────────────────────┐
  823. //│  Description: Area Message System                                        │
  824. //│       Author: Vic Lewis                                                  │
  825. //│ Date created: 04-19-92                                                   │
  826. //│ Time created: 08:22:09am                                                 │
  827. //│    Copyright: Trilateral Systems Development Ltd.                        │
  828. //├──────────────────────────────────────────────────────────────────────────┤
  829. //│     Function: TSD30003                                                   │
  830. //│                                                                          │
  831. //│    Arguments: None.                                                      │
  832. //│                                                                          │
  833. //│ Return Value: NIL                                                        │
  834. //│                                                                          │
  835. //└──────────────────────────────────────────────────────────────────────────┘
  836. FUNCTION TSD30003()
  837. BEEPER
  838. twInfoLine( 5, "twInfoLine() Puts Messages in a Pre-Defined Area. ( «Any Key» or «Button» )" , "L" )
  839. BEEPER
  840. twInfoLine( 5, "You Pick the Justification ( «Any Key» or «Button» )" , "C" )
  841. BEEPER
  842. twInfoLine( 5, "You can also Change the Area! ( «Any Key» or «Button» )" , "R", 20 )
  843. BEEPER
  844. twInfoLine( 5, "You can have «TWO» Colour Attributes too! ( «Any Key» or «Button» )" )
  845. BEEPER
  846. twWarnLine( 5, "twWarnLine() is the same «EXCEPT» for the default colour." )
  847. RETURN NIL
  848.  
  849. //┌──────────────────────────────────────────────────────────────────────────┐
  850. //│  Description: Messages Mouse Support                                     │
  851. //│       Author: Vic Lewis                                                  │
  852. //│ Date created: 04-19-92                                                   │
  853. //│ Time created: 08:22:09am                                                 │
  854. //│    Copyright: Trilateral Systems Development Ltd.                        │
  855. //├──────────────────────────────────────────────────────────────────────────┤
  856. //│     Function: TSD30004                                                   │
  857. //│                                                                          │
  858. //│    Arguments: None.                                                      │
  859. //│                                                                          │
  860. //│ Return Value: NIL                                                        │
  861. //│                                                                          │
  862. //└──────────────────────────────────────────────────────────────────────────┘
  863. FUNCTION TSD30004()
  864. LOCAL aMsg := {}
  865. AADD( aMsg, "Mouse support for the TSDWIN message systems is automatic." )
  866. AADD( aMsg, "" )
  867. AADD( aMsg, "When using twInfo() and twWarn() the right button  returns" )
  868. AADD( aMsg, "the ESC key and the left button, the ENTER key." )
  869. AADD( aMsg, "" )
  870. AADD( aMsg, "With the Alert Boxes,  the  Right Button always enters ESC" )
  871. AADD( aMsg, "The left will 'Select' in twButtonBox() and 'Tag  or Mark'" )
  872. AADD( aMsg, "in twCheckBox() and twRadioBox()" )
  873. AADD( aMsg, "" )
  874. AADD( aMsg, "twInfoLine() and twWarnLine() simply wait for a button  or" )
  875. AADD( aMsg, "key press, IF they are in a waiting state. " )
  876. AADD( aMsg, "" )
  877. AADD( aMsg, "The windowed and area messages may be called to:" )
  878. AADD( aMsg, "       Wait for a button or key press" )
  879. AADD( aMsg, "       Leave their display on the screen" )
  880. AADD( aMsg, "       Leave their display then remove it later." )
  881. UserMsg( aMsg )
  882. RETURN NIL
  883.  
  884. //┌──────────────────────────────────────────────────────────────────────────┐
  885. //│  Description: Check a return value and display it.                       │
  886. //│       Author: Vic Lewis                                                  │
  887. //│ Date created: 04-19-92                                                   │
  888. //│ Time created: 08:32:36am                                                 │
  889. //│    Copyright: Trilateral Systems Development Ltd.                        │
  890. //├──────────────────────────────────────────────────────────────────────────┤
  891. //│     Function: CheckRtn                                                   │
  892. //│                                                                          │
  893. //│    Arguments: RetVal                                                     │
  894. //│                                                                          │
  895. //│ Return Value:                                                            │
  896. //│                                                                          │
  897. //└──────────────────────────────────────────────────────────────────────────┘
  898. FUNCTION CheckRtn( RetVal )
  899. LOCAL aTempArray := {}, aLen, Cntr
  900. IF VALTYPE( RetVal ) == 'N'
  901.     AADD( aTempArray, "Your Return Value Was:" )
  902.     AADD( aTempArray, "Element Number: "+STRINT( RetVal ))
  903.     twInfo( aTempArray,,,,, DSHADOW, DFRAME )
  904. ELSEIF VALTYPE( RetVal ) == 'A'
  905.     aLen := LEN( RetVal );Cntr:=0
  906.     AADD( aTempArray, "You Picked:" )
  907.     AEVAL( RetVal, {|| Cntr++, AADD( aTempArray, RetVal[ Cntr] ) } )
  908.     twInfo( aTempArray,,,,, DSHADOW, DFRAME )
  909. ENDIF
  910. RETURN .T.
  911.  
  912. //┌──────────────────────────────────────────────────────────────────────────┐
  913. //│  Description: TSDWIN Menu Systems                                        │
  914. //│       Author: Vic Lewis                                                  │
  915. //│ Date created: 04-19-92                                                   │
  916. //│ Time created: 09:25:16am                                                 │
  917. //│    Copyright: Trilateral Systems Development Ltd.                        │
  918. //├──────────────────────────────────────────────────────────────────────────┤
  919. //│     Function: TSD40000                                                   │
  920. //│                                                                          │
  921. //│    Arguments: None.                                                      │
  922. //│                                                                          │
  923. //│ Return Value: NIL                                                        │
  924. //│                                                                          │
  925. //└──────────────────────────────────────────────────────────────────────────┘
  926. FUNCTION TSD40000()
  927. LOCAL amArray, nChoice, cHeader, aMsg, wT, wL, nX
  928. LOCAL nRowSkip, cJustify, cUser, nStartRow, lSBar
  929. LOCAL aItems := { "one","two","three","four","five","six","seven","eight",;
  930.                 "nine","ten","eleven","twelve","thirteen","fourteen",;
  931.                 "fifteen","sixteen","seventeen","eighteen","nineteen",;
  932.                 "twenty" }
  933. LOCAL nRow := 5, nStartCol := 1, nEndCol := MAXCOL() - 1
  934. LOCAL nStart := 0
  935.  
  936. UserMsg( { "The Main Menu in this demo uses  'twMenuTo().",;
  937.            "This demonstration shows how  twPopMenu() and",;
  938.            "twPopChoice() can be used to create menus.", "",;
  939.            "The main differences between the two are  the",;
  940.            "automatic handling of HotKeys in  twPopMenu()",;
  941.            "and the different mouse confinement when  you",;
  942.            "use twPopChoice().", "",;
  943.            "For a more detailed description of the Choice",;
  944.            "functions, see the section on Browses!", "",;
  945.            "twLineMenu() gives you an expandable bar line",;
  946.            "menu with indicators and mouse support." })
  947.  
  948. twOpen( FULLSCREEN, COLORN, DSHADOW, D2FRAME, "", COLORFN )
  949. twTitle( PADC( "TSDWIN Menus", 30 ), TCOLOR, "T", "C" )
  950.  
  951. amArray := { "«1.» Menu Item 1", ;
  952.              "«2.» Menu Item 2", ;
  953.              "«3.» Menu Item 3", ;
  954.              "«4.» Menu Item 4", ;
  955.              "«5.» Menu Item 5", ;
  956.              "«Q.» Quit" }
  957. nChoice := 1
  958. DO WHILE nChoice != 0
  959.     cHeader    := "twPopMenu()"
  960.     aMsg       := NIL
  961.     wT         := 7
  962.     wL         := 15
  963.     nRowSkip   := 1
  964.     nChoice := twPopMenu( amArray, cHeader, aMsg, wT, wL, nChoice, MENUPCLR, ;
  965.                           DSHADOW, D2FRAME, MENUFCLR, MENUTCLR, nRowSkip )
  966.     DO CASE
  967.         CASE nChoice >= 1 .AND. nChoice <= 5
  968.             UserMsg( "You Chose " + STRINT( nChoice ))
  969.         CASE nChoice = 6
  970.             EXIT
  971.     ENDCASE
  972. ENDDO
  973.  
  974. nChoice := 1
  975. SETBLINK( .F. )
  976. DO WHILE nChoice != 0
  977.     cHeader    := "twPopMenu()"
  978.     aMsg       := NIL
  979.     wT         := 5
  980.     wL         := 15
  981.     nRowSkip   := 2
  982.     nChoice := twPopMenu( amArray, cHeader, aMsg, wT, wL, nChoice, MENUPCLR, ;
  983.                           DSHADOW, D2FRAME, MENUFCLR, MENUTCLR, nRowSkip )
  984.     DO CASE
  985.         CASE nChoice >= 1 .AND. nChoice <= 5
  986.             UserMsg( "You Chose " + STRINT( nChoice ))
  987.         CASE nChoice = 6
  988.             EXIT
  989.     ENDCASE
  990. ENDDO
  991.  
  992. nX := 0
  993. AEVAL( amArray, {|| nX++, amArray[ nX ] := ;
  994.                  STRTRAN( STRTRAN( amArray[ nX ], "»", "" ), "«", "" )})
  995. nChoice := 1
  996. DO WHILE nChoice != 0
  997.     cHeader    := "twPopChoice()"
  998.     aMsg       := NIL
  999.     wT         := 8
  1000.     wL         := 45
  1001.     cJustify   := "L"
  1002.     cUser      := NIL
  1003.     nStartRow  := 3
  1004.     lSBar      := .F.
  1005.     nChoice := twPopChoice( amArray, cHeader, wT, wL, nChoice, MENUPCLR, DSHADOW, ;
  1006.                             D2FRAME, MENUFCLR, cJustify, cUser, nStartRow, lSbar )
  1007.     DO CASE
  1008.         CASE nChoice >= 1 .AND. nChoice <= 5
  1009.             twInfo( "You Chose " + STRINT( nChoice ))
  1010.         CASE nChoice = 6
  1011.             EXIT
  1012.     ENDCASE
  1013. ENDDO
  1014.  
  1015. amArray := {}
  1016. FOR nChoice = 1 TO 30
  1017.     AADD( amArray, PADL( STRINT( nChoice ), 2 ) +   ". Menu Item " + STRINT( nChoice ))
  1018. NEXT
  1019. nChoice := 1
  1020. SETBLINK( .F. )
  1021. DO WHILE nChoice != 0
  1022.     cHeader    := "twPopChoice()"
  1023.     aMsg       := NIL
  1024.     wT         := 8
  1025.     wL         := 45
  1026.     cJustify   := "L"
  1027.     cUser      := NIL
  1028.     nStartRow  := 3
  1029.     lSBar      := .T.
  1030.     nChoice := twPopChoice( amArray, cHeader, wT, wL, nChoice, MENUPCLR, DSHADOW, ;
  1031.                             D2FRAME, MENUFCLR, cJustify, cUser, nStartRow, lSbar )
  1032.     IF nChoice >= 1 .AND. nChoice <= 30
  1033.         twInfo( "You Chose " + STRINT( nChoice ))
  1034.     ELSE
  1035.         EXIT
  1036.     ENDIF
  1037. ENDDO
  1038.  
  1039.  
  1040. DO WHILE .T.
  1041.  
  1042.     nChoice := twLineMenu( nRow, nStartCol, nEndCol, aItems, 2, MENUPCLR )
  1043.  
  1044.     IF nChoice = 0
  1045.         EXIT
  1046.     ENDIF
  1047.  
  1048.     UserMsg( "You Chose " + aItems[ nChoice ] )
  1049.  
  1050. ENDDO
  1051.  
  1052. aItems := {}
  1053. nRow += 3
  1054. USE Windemo
  1055. DO WHILE !EOF()
  1056.     AADD( aItems, " " +TRIM( Windemo->Ice_Cream ) )
  1057.     SKIP
  1058. ENDDO
  1059.  
  1060. DO WHILE .T.
  1061.  
  1062.     nChoice := twLineMenu( nRow, nStartCol + 2, nEndCol - 2, aItems,, MENUPCLR;
  1063.                             ,, .F.,, {|| twTitle( "Windowed twLineMenu() Test", TCOLOR) },;
  1064.                             , .T., DSHADOW, D2FRAME, MENUFCLR )
  1065.  
  1066.     IF nChoice = 0
  1067.         EXIT
  1068.     ENDIF
  1069.  
  1070.     UserMsg( "You Chose " + aItems[ nChoice ] )
  1071. ENDDO
  1072.  
  1073. twPop()
  1074. RETURN NIL
  1075.  
  1076. //┌──────────────────────────────────────────────────────────────────────────┐
  1077. //│  Description: TSDWIN Browse Systems                                      │
  1078. //│       Author: Vic Lewis                                                  │
  1079. //│ Date created: 04-19-92                                                   │
  1080. //│ Time created: 10:20:04am                                                 │
  1081. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1082. //├──────────────────────────────────────────────────────────────────────────┤
  1083. //│     Function: TSD50000                                                   │
  1084. //│                                                                          │
  1085. //│    Arguments: None                                                       │
  1086. //│                                                                          │
  1087. //│ Return Value: NIL                                                        │
  1088. //│                                                                          │
  1089. //└──────────────────────────────────────────────────────────────────────────┘
  1090. FUNCTION TSD50000()
  1091. LOCAL nTop, nLeft, nBottom, nRight, cUser, nStartItem, nWinRow, aSrch
  1092. LOCAL nTag, cACColor, cBarColor, wT, wL, wB, wR, nChoice, amArray, aLogicals
  1093. LOCAL nButRow, nButCol, aMouseID, f, nParts, nCost, nSell, aHelp, aColumns
  1094. LOCAL cTitle, cTopKey, bScopeBlock, lEditFlag, aActionKeys, wColor, wSType
  1095. LOCAL wFType, wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, bPreRun
  1096. LOCAL bPostRun, nExitKey, aSeparators, lOKAppend, lSound, nCount, aTemp
  1097.  
  1098. UserMsg( { "To conserve space, only the new  browses in  TSDWIN V 1.50",;
  1099.            "will be demonstrated here. They automatically invoke mouse",;
  1100.            "support if you have called twMouseInit() at the  beginning",;
  1101.            "of your program.", "",;
  1102.            "We shall show you:", "",;
  1103.            "    twACChoice() - a moused replacement for ACHOICE()",;
  1104.            "    twABBrowse() - a simple array browser.",;
  1105.            "    twRABrowse() - a totally configurable array browser.",;
  1106.            "    twBRBrowse() - a totally configurable DBF browser.", "",;
  1107.            "You should consult TSDWIN.NG for more information on these",;
  1108.            "functions, as they are very flexible.", "",;
  1109.            "During the demo, the line at the bottom of the screen, and",;
  1110.            "displayed buttons will be Mouse Hot Spots." })
  1111.  
  1112. twOpen( FULLSCREEN, COLORM, DSHADOW, DFRAME, "∙", COLORFM )
  1113. twTitle( PADC( "TSDWIN Browse Systems", 30 ), TCOLOR, "T", "C" )
  1114.  
  1115. twOpen( 3, 3, 21, 76, COLORN, DSHADOW, DFRAME,, COLORFN )
  1116.  
  1117. nTop       := twRow( 3 )
  1118. nLeft      := twCol( 4 )
  1119. nBottom    := twRow( 10 )
  1120. nRight     := twCol( 22 )
  1121. cUser      := NIL
  1122. nStartItem := 1
  1123. nWinRow    := 1
  1124. lScBar     := .T.
  1125. nTag       := 0
  1126. cACColor   := IIF( ! lMono, "w+/br,gr+/r,n/bg,w+/r,w/br", ;
  1127.                             "w+/n,n/w,n/w,w/n,w+/n" )
  1128. cBarColor  := IIF( ! lMono, "w+/g" , "n/w" )
  1129.  
  1130. twClear( .F.)
  1131. twTitle( PADC( "twACChoice() with No Tagging + Logicals", 55 ), "n/w")
  1132. twSay( 12, 3, "Right Button: Exit   │ Left Button: Select" )
  1133. twSay( 13, 3, "       ENTER: Select │         ESC: Exit" )
  1134. twSay( 14, 3, 'cACColor  := "w+/br,gr+/r,n/bg,w+/r,w/br"' )
  1135. twSay( 15, 3, 'cBarColor := "w+/g"' )
  1136. twSay( 16, 3, '     nTag := 0' )
  1137. twBox( 2, 3, 11, 24, 1 )
  1138. nChoice := 1
  1139. DO WHILE nChoice != 0
  1140.  
  1141.     amArray := {}
  1142.     FOR nChoice = 1 TO 30
  1143.         AADD( amArray, PADL( STRINT( nChoice ), 2 ) +   ". Menu Item " + STRINT( nChoice ))
  1144.     NEXT
  1145.     aLogicals := ARRAY( 30 )
  1146.     AFILL( aLogicals, .T. )
  1147.     aLogicals[ 04 ] := .F.
  1148.     aLogicals[ 14 ] := .F.
  1149.     aLogicals[ 15 ] := .F.
  1150.     aLogicals[ 20 ] := .F.
  1151.     aLogicals[ 22 ] := .F.
  1152.     aLogicals[ 23 ] := .F.
  1153.     aLogicals[ 24 ] := .F.
  1154.     aLogicals[ 25 ] := .F.
  1155.     aLogicals[ 26 ] := .F.
  1156.  
  1157.     nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
  1158.                         aLogicals, cUser, nStartItem, nWinRow, ;
  1159.                         lScBar, nTag, cACColor, cBarColor )
  1160.     UserMsg( "You Chose " + STRINT( nChoice ))
  1161.  
  1162. ENDDO
  1163.  
  1164. twClear( .F.)
  1165. nButRow := _twTop()
  1166. nButCol := 50
  1167. cACColor   := IIF( ! lMono, "w+/g,bg+/n,n/bg,w+/r,w/gr", ;
  1168.                             "w+/n,n/w,n/w,w/n,w+/n" )
  1169. cBarColor  := IIF( ! lMono, "n/bg+" , "n/w" )
  1170.  
  1171. aMouseID := ARRAY( 7 )
  1172. twCreateButton( nButRow, nButCol, PADC( "Help", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
  1173. aMouseID[ 1 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1174.                     {|| SpotDeactivate( aMouseID ),;
  1175.                         _twKBoard( K_F1 ),;
  1176.                         SpotActivate( aMouseID ) } , 1, , .T. )
  1177. nButRow += 2
  1178. twCreateButton( nButRow, nButCol, PADC( "Tag All", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
  1179. aMouseID[ 2 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1180.                     {|| _twKBoard( K_F7 ) } , 1, , .T. )
  1181. nButRow += 2
  1182. twCreateButton( nButRow, nButCol, PADC( "UnTag All", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
  1183. aMouseID[ 3 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1184.                     {|| _twKBoard( K_F8 ) } , 1, , .T. )
  1185. nButRow += 2
  1186. twCreateButton( nButRow, nButCol, PADC( "Swap Tags", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
  1187. aMouseID[ 4 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1188.                     {|| _twKBoard( K_F9 ) } , 1, , .T. )
  1189. nButRow += 2
  1190. twCreateButton( nButRow, nButCol, PADC( "Tag Current", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
  1191. aMouseID[ 5 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1192.                     {|| __keyboard( CHR( 32 ))} , 1, , .T. )
  1193. nButRow += 2
  1194. twCreateButton( nButRow, nButCol, PADC( "Select", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
  1195. aMouseID[ 6 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1196.                     {|| __keyboard( CHR( 13 ))} , 1, , .T. )
  1197. nButRow += 2
  1198. twCreateButton( nButRow, nButCol, PADC( "Done", 13), .F., IIF( !lMono, "gr+/r", "n/w"))
  1199. aMouseID[ 7 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1200.                     {|| __keyboard( CHR( 27 ))} , 1, , .T. )
  1201.  
  1202. SETKEY( K_F1, {|| HelpACChoice() } )
  1203.  
  1204. nTag       := 1 // Allow Tagging, NOT pretagged
  1205.  
  1206. twTitle( PADC( "twACChoice() with Default Tagging + NIL Logicals", 55 ), "n/w")
  1207. twSay( 12, 3, "Right Button: Tag    │ Left Button: Select" )
  1208. twSay( 13, 3, "       ENTER: Select │         ESC: Exit" )
  1209. twSay( 14, 3, "       SPACE: Tag" )
  1210. twSay( 15, 3, 'cACColor  := "w+/b,bg+/n,n/bg,w+/r,w/gr"' )
  1211. twSay( 16, 3, 'cBarColor := "n/bg+"' )
  1212. twSay( 17, 3, '     nTag := 1' )
  1213. nChoice := 1
  1214. DO WHILE nChoice != 0
  1215.  
  1216.     amArray := {}
  1217.     FOR nChoice = 1 TO 30
  1218.         AADD( amArray, PADL( STRINT( nChoice ), 2 ) +   ". Menu Item " + STRINT( nChoice ))
  1219.     NEXT
  1220.     aLogicals := ARRAY( 30 )
  1221.     aLogicals := NIL
  1222.  
  1223.     nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
  1224.                         aLogicals, cUser, nStartItem, nWinRow, ;
  1225.                         lScBar, nTag, cACColor, cBarColor )
  1226.     UserMsg( "You Chose " + STRINT( nChoice ))
  1227. ENDDO
  1228.  
  1229. nTag       := 2 // Allow tagging - PreTagged
  1230.  
  1231. nChoice := 1
  1232. cACColor   := IIF( ! lMono, "n/bg,gr+/r,r/w,w+/g,w/b", ;
  1233.                             "w+/n,n/w,n/w,w/n,w+/n" )
  1234. cBarColor  := IIF( ! lMono, "w+/b" , "n/w" )
  1235. twTitle( PADC( "twACChoice() with Pre-Tagging + True Logicals", 55 ), "n/w")
  1236. twSay( 12, 3, "Right Button: Tag    │ Left Button: Select" )
  1237. twSay( 13, 3, "       ENTER: Select │         ESC: Exit" )
  1238. twSay( 14, 3, "       SPACE: Tag" )
  1239. twSay( 15, 3, 'cACColor   := "n/bg,gr+/r,r/w,w+/g,w/b"' )
  1240. twSay( 16, 3, 'cBarColor  := "w+/b"' )
  1241. twSay( 17, 3, '     nTag := 2' )
  1242. DO WHILE nChoice != 0
  1243.     amArray := {}
  1244.     FOR nChoice = 1 TO 30
  1245.         AADD( amArray, PADL( STRINT( nChoice ), 2 ) +   ". Menu Item " + STRINT( nChoice ))
  1246.     NEXT
  1247.     aLogicals := ARRAY( 30 )
  1248.     AFILL( aLogicals, .T. )
  1249.     FOR f = 1 TO LEN( amArray )
  1250.         // Create some tags
  1251.         IF f / 2 == INT( f / 2 )
  1252.             amArray[ f ] := amArray[ f ] + "√"
  1253.         ELSE
  1254.             amArray[ f ] := amArray[ f ] + " "
  1255.         ENDIF
  1256.     NEXT
  1257.  
  1258.     nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
  1259.                         aLogicals, cUser, nStartItem, nWinRow, ;
  1260.                         lScBar, nTag, cACColor, cBarColor )
  1261.     UserMsg( "You Chose " + STRINT( nChoice ))
  1262. ENDDO
  1263. twPop()
  1264. FOR nChoice = 1 TO 7
  1265.     twACRemHotSpot( aMouseID[ nChoice ] )
  1266. NEXT
  1267.  
  1268. SET DELETED ON
  1269. SET CONFIRM ON
  1270.  
  1271. USE PART INDEX PART1 ALIAS Part NEW
  1272. nParts := 0; nCost := 0; nSell := 0
  1273. DBEVAL( {|| nParts += Part->PonHand, ;
  1274.             nCost += ( Part->PonHand * Part->PCost ),;
  1275.             nSell += ( Part->PonHand * Part->PSell ) } )
  1276. GO TOP
  1277.  
  1278. aHelp := {}
  1279. AADD( aHelp, {|| BRHelp( "GENHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1280. AADD( aHelp, {|| BRHelp( "COLHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1281. AADD( aHelp, {|| BRHelp( "ACTHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1282. AADD( aHelp, {|| BRHelp( "HOTHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1283. AADD( aHelp, {|| BRHelp( "MSEHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1284. AADD( aHelp, {|| BRHelp( "CARHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1285.  
  1286. wT          := 3
  1287. wL          := 11
  1288. wB          := 21
  1289. wR          := 68
  1290. aColumns    := {}
  1291. cTitle      := NIL
  1292. cTopKey     := NIL
  1293. bScopeBlock := NIL
  1294. lEditFlag   := .T.
  1295. aActionKeys := {}
  1296. wColor   := IIF( ! lMono, "w+/b,gr+/r,,gr+/b,bg+/b,br+/b,g+/b,n/w", ;
  1297.                           "w+/n,n/w,,w/n,w+/n,w/n,w+/n,n/w" )
  1298. wSType      := 3
  1299. wFType      := 10
  1300. wFColor     := IIF( !lMono, { "w+/b", "w/b" }, { "w+/n", "w/n"} )
  1301. lScBar      := .T.
  1302. lMsgs       := .T.
  1303. lAlite      := .T.
  1304. nFreeze     := 3
  1305. lStabilize  := .T.
  1306. bPreRun     := {|x,y| twTitle( "Sample Inventory Maintenance", "n/w", "T", "C" ),;
  1307.                     x := twBRGetBrowse(), y := x:GETCOLUMN( 2 ),;
  1308.                     y:colorblock := {|| { 5, 2 } },;
  1309.                     y := x:GETCOLUMN( 3 ),;
  1310.                     y:colorblock := {|| IIF( Part->POnHand > 500, { 1, 2 }, ;
  1311.                                         IIF( Part->POnHand < 100,  { 7,  2 }, { 6, 2 } )) },;
  1312.                     x:ColPos := 1 }
  1313. bPostRun    := NIL
  1314. nExitKey    := K_ALT_X
  1315. aSeparators := { "═", "  ", "─" }
  1316. lOKAppend   := .T.
  1317. lSound      := .T.
  1318. // aSrch array structure
  1319. //
  1320. //  { Column Number in which to start key display,
  1321. //    Hilite Bar Exception Color
  1322. //    Code block for search access to dbf.
  1323. //    Prefix for common keys in scoped browses,
  1324. //    Mask for display bar. }
  1325.  
  1326. //------------------------------------------------------------------------
  1327. //
  1328. // add columns
  1329. //AADD( aColumns, { cHead, bBlk, nWid, cFoot, lEdit, cPic, bWhn, bVld, ;
  1330. //                  bRdr, aClr, bClr, cCsep, cHsep, cFsep })
  1331. //
  1332. //------------------------------------------------------------------------
  1333. aColumns := {}
  1334. AADD( aColumns, { "Part;Number", ;
  1335.                     {|x| IIF( x=NIL, Part->Pnumber, Part->Pnumber := x ) } ;
  1336.                     ,,, .T., "@! XXX-999999999",,, {|x| BRGetReader(x,,.T.) } })
  1337. AADD( aColumns, { "Part;Description", ;
  1338.                     {|x| IIF( x=NIL, Part->PDesc, Part->PDesc := x ) } ;
  1339.                     ,, "Total;Values;", .T., "@X",,, {|x| BRGetReader(x,,.T.) } })
  1340. AADD( aColumns, { "Number;On Hand", ;
  1341.                     {|x| IIF( x=NIL, Part->POnHand, Part->POnHand := x ) } ;
  1342.                     ,, TRANSFORM( nParts, "999999" ) + ";     $",;
  1343.                     .T., "9999",, {|x| ShowParts(x, @nParts, @nSell, @nCost ) }, {|x| BRGetReader(x,,.T.) } })
  1344. AADD( aColumns, { "Selling;Price", ;
  1345.                     {|x| IIF( x=NIL, Part->PSell, Part->PSell := x ) } ;
  1346.                     ,, "  ;" + TRANSFORM( nSell, "9999999.99" ),;
  1347.                     .T., "9999.99",, {|x| ShowSell(x, @nSell ) }, {|x| BRGetReader(x,,.T.) } })
  1348. AADD( aColumns, { "Cost;Price", ;
  1349.                     {|x| IIF( x=NIL, Part->PCost, Part->PCost := x ) } ;
  1350.                     ,, "  ;" + TRANSFORM( nCost, "9999999.99" ), .T., "9999.99",, {|x| ShowCost(x, @nCost ) } })
  1351.                     //,, .T., "9999.99",, {|x| ShowCost(x, @nCost ) }, {|x| BRGetReader(x,.F.) } })
  1352.  
  1353. //------------------------------------------------------------------------
  1354. //
  1355. // add actionkeys
  1356. //
  1357. //------------------------------------------------------------------------
  1358.  
  1359. aActionKeys := {}
  1360. AADD( aActionKeys, { K_F1, aHelp[ 1 ] })
  1361. AADD( aActionKeys, { K_F2, aHelp[ 2 ] })
  1362. AADD( aActionKeys, { K_F3, aHelp[ 3 ] })
  1363. AADD( aActionKeys, { K_F4, aHelp[ 4 ] })
  1364. AADD( aActionKeys, { K_F5, aHelp[ 5 ] })
  1365. AADD( aActionKeys, { K_F6, aHelp[ 6 ] })
  1366.  
  1367. //------------------------------------------------------------------------
  1368. //
  1369. // Add the Hot Spots
  1370. //
  1371. //------------------------------------------------------------------------
  1372.  
  1373. aMouseID := ARRAY( 6 )
  1374. aMouseID[ 1 ] := twBRHotSpot( 24, 0, 24, 9,   aHelp[ 1 ], ;
  1375.                                 1,, .T. )
  1376. aMouseID[ 2 ] := twBRHotSpot( 24, 11, 24, 20, aHelp[ 2 ], ;
  1377.                                 1,, .T. )
  1378. aMouseID[ 3 ] := twBRHotSpot( 24, 22, 24, 34, aHelp[ 3 ], ;
  1379.                                 1,, .T. )
  1380. aMouseID[ 4 ] := twBRHotSpot( 24, 36, 24, 47, aHelp[ 4 ], ;
  1381.                                 1,, .T. )
  1382. aMouseID[ 5 ] := twBRHotSpot( 24, 49, 24, 56, aHelp[ 5 ], ;
  1383.                                 1,, .T. )
  1384. aMouseID[ 6 ] := twBRHotSpot( 24, 58, 24, 65, aHelp[ 6 ], ;
  1385.                                 1,, .T. )
  1386. aMouseID[ 6 ] := twBRHotSpot( 24, 67, 24, 74, {|| __keyboard( CHR( K_ESC )) } , ;
  1387.                                 1,, .T. )
  1388.  
  1389. //twInfoLine( -2, "             «twBRBrowse()» with «Actionkeys», «HotSpots», «Edits» and «Appends»", "P", 2 )
  1390. twInfoLine( -2, "«F1»∙General «F2»∙Columns «F3»∙Actionkeys «F4»∙Hot Spots «F5»∙Mouse «F6»∙Cargo «ESC»∙Exit" )
  1391. DO WHILE .T.
  1392.  
  1393.     twBRBrowse( wT, wL, wB, wR, aColumns, cTitle, cTopKey, ;
  1394.                 bScopeBlock, lEditFlag, aActionKeys, wColor, wSType, wFType, ;
  1395.                 wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, ;
  1396.                 bPreRun, bPostRun, nExitKey, aSeparators, ;
  1397.                 lOKAppend, lSound )
  1398.  
  1399.     IF LASTKEY() == K_ESC
  1400.         EXIT
  1401.     ENDIF
  1402. ENDDO
  1403.  
  1404. lAlite  := .F.
  1405. bPreRun := NIL
  1406. cTitle  := "Now Try The Speed Searching"
  1407. aSrch   := { 1, IIF( ! lMono, "n/*gr" , "w+/n" ) }
  1408.  
  1409. DO WHILE .T.
  1410.  
  1411.     twBRBrowse( wT, wL, wB, wR, aColumns, cTitle, cTopKey, ;
  1412.                 bScopeBlock, lEditFlag, aActionKeys, wColor, wSType, wFType, ;
  1413.                 wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, ;
  1414.                 bPreRun, bPostRun, nExitKey, aSeparators, ;
  1415.                 lOKAppend, lSound,,, aSrch )
  1416.  
  1417.     IF LASTKEY() == K_ESC
  1418.         EXIT
  1419.     ENDIF
  1420. ENDDO
  1421.  
  1422. //------------------------------------------------------------------------
  1423. //
  1424. // Remove the mouse hot spots.
  1425. // MUST Release memory!!!!
  1426. //
  1427. //------------------------------------------------------------------------
  1428.  
  1429. FOR nCount = 1 TO LEN( aMouseID )
  1430.     twBRRemHotSpot( aMouseID[ nCount ] )
  1431. NEXT
  1432.  
  1433. twAMPop()
  1434.  
  1435. aTemp := {}
  1436. FOR nCount = 1 TO 10
  1437.     AADD( aTemp, "Array Element " + STR( nCount, 3 ) )
  1438. NEXT
  1439.  
  1440. wT          := 3
  1441. wL          := 25
  1442. wB          := 21
  1443. wR          := 54
  1444. wColor   := IIF( ! lMono, "bg+/rg,gr+/n,,w+/rg,bg+/b,r/w,w+/b,w+/g,n/w", ;
  1445.                           "w+/n,n/w,,w+/n,w/n,n/w,w+/n,w/n,n/w" )
  1446. wFColor     := IIF( !lMono, { "gr+/g", "w/b" }, { "w+/n", "w/n"} )
  1447. aColumns := {}
  1448. AADD( aColumns, { "      Column Header", 1,, "      Column Footer", .F.,,,,, ;
  1449.                      { 5, 2 }, {|| IIF( twRAGetCurrent() % 3 = 0,;
  1450.                                 { 4, 6 }, { 7, 8 } ) },;
  1451.                      , "═", "■" } )
  1452.  
  1453. //twInfoLine( -2, "                        «twRABrowse()» with «Append»", "P", 2 )
  1454. twInfoLine( -2, "«Single Element» Array  «ESC»∙Exit" )
  1455. nChoice := twRABrowse( wT, wL, wB, wR, aTemp, aColumns, ;
  1456.                        "Single Element Array" , ;
  1457.                        .T.,, wColor, ;
  1458.                        3, 1, wFColor, .T., .T., 1, .T.,;
  1459.                        ,, K_ALT_X,,, "Array Element New", .T. )
  1460. twAMPop()
  1461.  
  1462. wT          := 3
  1463. wL          := 5
  1464. wB          := 21
  1465. wR          := 74
  1466. aTemp := twDirectory( "*.*" )
  1467. ASORT( aTemp,,, {|x,y| x[ 1 ] < y[ 1 ] } )
  1468. aColumns := {}
  1469. AADD( aColumns, { "File Name", 1,, "Col1", .T., "@X", {|| 1=1 }, {|| 1=1 }} )
  1470. AADD( aColumns, { "Size",      2,, "Col2", .T., "@X", {|| 1=2 }, {|| 1=1 },, ;
  1471.                         { 4, 2 }, {|| IIF( twRAGetElement( 2 ) > 2000, ;
  1472.                                       IIF( twRAGetElement( 2 ) > 10000, { 4, 2 },;
  1473.                                                          { 7, 2 } ), { 5, 2 } ) },;
  1474.                         " > ", "═", "═" })
  1475. AADD( aColumns, { "Date",      3,, "Col3", .T., "@X", {|| 1=1 }, {|| 1=1 },,;
  1476.                         { 5, 2 }, {|| { 8, 2 }}, " < ", "═", "═" } )
  1477. AADD( aColumns, { "Time",      4,, "Col4", .T., "@X", {|| 1=2 }, {|| 1=1 }} )
  1478. AADD( aColumns, { "Attribute", 5,, "Col5", .T., "@X", {|| 1=1 }, {|| 1=1 },,;
  1479.                         { 7, 2 }} )
  1480.  
  1481. twInfoLine( -2, "«Nested» Array with special column display  «ESC»∙Exit" )
  1482. nChoice := twRABrowse( wT, wL, wB, wR, aTemp, aColumns, ;
  1483.                        "Directory of Files in " + CURDIR() , ;
  1484.                        .T.,, ;
  1485.                        IIF( ! lMono, "bg+/rg,gr+/n,,g+/rg,gr+/rg,gr+/r,br+/rg,n/w", ;
  1486.                                      "w+/n,n/w,,w/n,w+/n,n/w,w+/n,n/w" ), ;
  1487.                        3, 1, IIF( ! lMono, "gr+/g", "w+/n" ), ;
  1488.                        .T., .T., 1, .T.,,, K_ALT_X )
  1489.  
  1490. UserMsg( "You Chose: " + STRINT( nChoice )  + IIF( nChoice =  0, '', aTemp [ nChoice, 1 ]))
  1491. twAMPop()
  1492.  
  1493. twPop()
  1494. RETURN NIL
  1495.  
  1496. //┌──────────────────────────────────────────────────────────────────────────┐
  1497. //│  Description: Disable Mouse Spots in twACChoice() Demo                   │
  1498. //│       Author: Vic Lewis                                                  │
  1499. //│ Date created: 04-19-92                                                   │
  1500. //│ Time created: 05:39:05pm                                                 │
  1501. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1502. //├──────────────────────────────────────────────────────────────────────────┤
  1503. //│     Function: SpotDeactivate                                             │
  1504. //│                                                                          │
  1505. //│    Arguments: xSpot - Spots to Disable                                   │
  1506. //│                                                                          │
  1507. //│ Return Value: NIL                                                        │
  1508. //│                                                                          │
  1509. //└──────────────────────────────────────────────────────────────────────────┘
  1510. FUNCTION SpotDeactivate( xSpot )
  1511. LOCAL nX
  1512. IF VALTYPE( xSpot ) = 'A'
  1513.     FOR nX = 1 TO LEN( xSpot )
  1514.         twACSpotOff( xSpot[ nX ] )
  1515.     NEXT
  1516. ELSE
  1517.     twACSpotOff( xSpot )
  1518. ENDIF
  1519. RETURN NIL
  1520.  
  1521. //┌──────────────────────────────────────────────────────────────────────────┐
  1522. //│  Description: Reactivate Mouse Spots in twACChoice() Demo                │
  1523. //│       Author: Vic Lewis                                                  │
  1524. //│ Date created: 04-19-92                                                   │
  1525. //│ Time created: 05:37:52pm                                                 │
  1526. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1527. //├──────────────────────────────────────────────────────────────────────────┤
  1528. //│     Function: SpotActivate                                               │
  1529. //│                                                                          │
  1530. //│    Arguments: xSpot - Spot to reactivate                                 │
  1531. //│                                                                          │
  1532. //│ Return Value: NIL                                                        │
  1533. //│                                                                          │
  1534. //└──────────────────────────────────────────────────────────────────────────┘
  1535. FUNCTION SpotActivate( xSpot )
  1536. LOCAL nX
  1537. IF VALTYPE( xSpot ) = 'A'
  1538.     FOR nX = 1 TO LEN( xSpot )
  1539.         twACSpotOn( xSpot[ nX ] )
  1540.     NEXT
  1541. ELSE
  1542.     twACSpotOn( xSpot )
  1543. ENDIF
  1544. RETURN NIL
  1545.  
  1546. //┌──────────────────────────────────────────────────────────────────────────┐
  1547. //│  Description: Help  for twACChoice() Demo                                │
  1548. //│       Author: Vic Lewis                                                  │
  1549. //│ Date created: 04-19-92                                                   │
  1550. //│ Time created: 05:37:08pm                                                 │
  1551. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1552. //├──────────────────────────────────────────────────────────────────────────┤
  1553. //│     Function: HelpACChoice                                               │
  1554. //│                                                                          │
  1555. //│    Arguments: None                                                       │
  1556. //│                                                                          │
  1557. //│ Return Value: NIL                                                        │
  1558. //│                                                                          │
  1559. //└──────────────────────────────────────────────────────────────────────────┘
  1560. FUNCTION HelpACChoice()
  1561. LOCAL aMsg := {}, bF1 := SETKEY( K_F1, NIL )
  1562. AADD( aMsg, "twACChoice() has  different default key and mouse actions" )
  1563. AADD( aMsg, "depending on the setting of the 'tagging' parameter:" )
  1564. AADD( aMsg, "" )
  1565. AADD( aMsg, "       nTag = 0 ( No Tagging )" )
  1566. AADD( aMsg, "" )
  1567. AADD( aMsg, "Left Button - Select │ Right Button - Exit w/o choice" )
  1568. AADD( aMsg, "      ENTER - Select │          ESC - Exit w/o choice" )
  1569. AADD( aMsg, "" )
  1570. AADD( aMsg, "       nTag = 1 ( Start with untagged array )" )
  1571. AADD( aMsg, "       nTag = 2 ( Start with Pre-Tagged array )" )
  1572. AADD( aMsg, "" )
  1573. AADD( aMsg, "Left Button - Select │ Right Button - Tag current" )
  1574. AADD( aMsg, "      ENTER - Select │        SPACE - Tag Current" )
  1575. AADD( aMsg, "               ESC - EXIT w/o choice" )
  1576. AADD( aMsg, "" )
  1577. AADD( aMsg, "       F7 - Tag All" )
  1578. AADD( aMsg, "       F8 - Untag All" )
  1579. AADD( aMsg, "       F9 - Swap tagged with untagged" )
  1580. twInfo( aMsg, "twACChoice() Help",,,, 3, 10 )
  1581. SETKEY( K_F1, bF1 )
  1582. RETURN NIL
  1583.  
  1584. //┌──────────────────────────────────────────────────────────────────────────┐
  1585. //│  Description: Read Help for twBRBrowse() Demo                            │
  1586. //│       Author: Vic Lewis                                                  │
  1587. //│ Date created: 04-19-92                                                   │
  1588. //│ Time created: 05:35:35pm                                                 │
  1589. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1590. //├──────────────────────────────────────────────────────────────────────────┤
  1591. //│     Function: BRHelp                                                     │
  1592. //│                                                                          │
  1593. //│    Arguments: cFile  - File Name                                         │
  1594. //│               cTitle - Title                                             │
  1595. //│               aMouseSpots - Mouse Spots to disable                       │
  1596. //│                                                                          │
  1597. //│ Return Value: NIL                                                        │
  1598. //│                                                                          │
  1599. //└──────────────────────────────────────────────────────────────────────────┘
  1600. FUNCTION BRHelp( cFile, cTitle, aMouseSpots )
  1601. LOCAL aHandles, cMemo, nX
  1602.  
  1603. FOR nX := 1 TO LEN( aMouseSpots )
  1604.     twBRSpotOff( aMouseSpots[ nX ] )
  1605. NEXT
  1606.  
  1607. twInfoLine( -2, "«Up/Dn»∙«Page»∙Scroll Text «ESC»∙Done" )
  1608. twTextFile( 7, 08, 20, 71, cFile, "n/w", ;
  1609.         3, 10, "b+/w", cTitle )
  1610. twAMPop()
  1611.  
  1612. FOR nX := 1 TO LEN( aMouseSpots )
  1613.     twBRSpotOn( aMouseSpots[ nX ] )
  1614. NEXT
  1615. RETURN NIL
  1616.  
  1617. //┌──────────────────────────────────────────────────────────────────────────┐
  1618. //│  Description: Footers display for twBRBrowse() Demo VALID clause         │
  1619. //│       Author: Vic Lewis                                                  │
  1620. //│ Date created: 04-19-92                                                   │
  1621. //│ Time created: 05:40:19pm                                                 │
  1622. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1623. //├──────────────────────────────────────────────────────────────────────────┤
  1624. //│     Function: ShowParts                                                  │
  1625. //│                                                                          │
  1626. //│    Arguments: oGet   - Active Get                                        │
  1627. //│               nParts - Parts on hand                                     │
  1628. //│               nSell  - Selling price                                     │
  1629. //│               nCost  - Cost price                                        │
  1630. //│                                                                          │
  1631. //│ Return Value: TRUE for the VALID                                         │
  1632. //│                                                                          │
  1633. //└──────────────────────────────────────────────────────────────────────────┘
  1634. FUNCTION ShowParts( oGet, nParts, nSell, nCost )
  1635. LOCAL oB := twBRGetBrowse(), oCol
  1636. LOCAL nOldValue := Part->POnHand, nDiff, nNewValue := EVAL( oGet:block )
  1637. LOCAL nNewDollars
  1638. nDiff := nOldValue - nNewValue
  1639. oCol := oB:GETCOLUMN( 3 )
  1640. nParts -= nDiff
  1641. oCol:Footing := TRANSFORM( nParts, "999999" ) + ";     $"
  1642. nOldValue := Part->POnHand * Part->PSell
  1643. nNewDollars := nNewValue * Part->PSell
  1644. nDiff := nOldValue - nNewDollars
  1645. nSell -= nDiff
  1646. oCol := oB:GETCOLUMN( 4 )
  1647. oCol:Footing := "  ;" + TRANSFORM( nSell, "9999999.99" )
  1648. nOldValue := Part->POnHand * Part->PCost
  1649. nNewDollars := nNewValue * Part->PCost
  1650. nDiff := nOldValue - nNewDollars
  1651. nCost  -= nDiff
  1652. oCol := oB:GETCOLUMN( 5 )
  1653. oCol:Footing := "  ;" + TRANSFORM( nCost, "9999999.99" )
  1654. oB:Configure()
  1655. RETURN .T.
  1656.  
  1657. //┌──────────────────────────────────────────────────────────────────────────┐
  1658. //│  Description: VALID clause for selling price in twBRBrowse() Demo        │
  1659. //│       Author: Vic Lewis                                                  │
  1660. //│ Date created: 04-19-92                                                   │
  1661. //│ Time created: 05:43:16pm                                                 │
  1662. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1663. //├──────────────────────────────────────────────────────────────────────────┤
  1664. //│     Function: ShowSell                                                   │
  1665. //│                                                                          │
  1666. //│    Arguments: oGet  - Active Get                                         │
  1667. //│               nSell - Selling price                                      │
  1668. //│                                                                          │
  1669. //│ Return Value: TRUE for the VALID                                         │
  1670. //│                                                                          │
  1671. //└──────────────────────────────────────────────────────────────────────────┘
  1672. FUNCTION ShowSell( oGet, nSell )
  1673. LOCAL oB := twBRGetBrowse(), oCol
  1674. LOCAL nOldValue := Part->PSell * Part->POnHand
  1675. LOCAL nDiff := nOldValue  -  ( Part->POnHand * EVAL( oGet:block ))
  1676. oCol := oB:GETCOLUMN( 4 )
  1677. nSell -= nDiff
  1678. oCol:Footing := "  ;" + TRANSFORM( nSell, "9999999.99" )
  1679. oB:Configure()
  1680. RETURN .T.
  1681.  
  1682. //┌──────────────────────────────────────────────────────────────────────────┐
  1683. //│  Description: VALID clause for cost price in twBRBrowse() Demo           │
  1684. //│       Author: Vic Lewis                                                  │
  1685. //│ Date created: 04-19-92                                                   │
  1686. //│ Time created: 05:44:44pm                                                 │
  1687. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1688. //├──────────────────────────────────────────────────────────────────────────┤
  1689. //│     Function: ShowCost                                                   │
  1690. //│                                                                          │
  1691. //│    Arguments: oGet  - Active get                                         │
  1692. //│                    nCost - Cost price                                    │
  1693. //│                                                                          │
  1694. //│ Return Value: TRUE for the VALID                                         │
  1695. //│                                                                          │
  1696. //└──────────────────────────────────────────────────────────────────────────┘
  1697. FUNCTION ShowCost( oGet, nCost )
  1698. LOCAL oB := twBRGetBrowse(), oCol
  1699. LOCAL nOldValue := Part->PCost * Part->POnHand
  1700. LOCAL nDiff := nOldValue  -  ( Part->POnHand * EVAL( oGet:block ))
  1701. oCol := oB:GETCOLUMN( 5 )
  1702. nCost -= nDiff
  1703. oCol:Footing := "  ;" + TRANSFORM( nCost, "9999999.99" )
  1704. oB:Configure()
  1705. RETURN .T.
  1706.  
  1707.  
  1708. //┌──────────────────────────────────────────────────────────────────────────┐
  1709. //│  Description: Mouse Support Display                                      │
  1710. //│       Author: Vic Lewis                                                  │
  1711. //│ Date created: 04-19-92                                                   │
  1712. //│ Time created: 05:52:57pm                                                 │
  1713. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1714. //├──────────────────────────────────────────────────────────────────────────┤
  1715. //│     Function: TSD60000                                                   │
  1716. //│                                                                          │
  1717. //│    Arguments: None                                                       │
  1718. //│                                                                          │
  1719. //│ Return Value: NIL                                                        │
  1720. //│                                                                          │
  1721. //└──────────────────────────────────────────────────────────────────────────┘
  1722. FUNCTION TSD60000()
  1723. LOCAL nCount := 0, nTime :=  SECONDS(), lShowPresses := .F.
  1724. LOCAL nMRow, nMCol, nButton := 0
  1725. UserMsg( { "In TSDWIN, Mouse support is almost automatic. A call to twMouseInit()",;
  1726.            "at the beginning of a program is all it takes.",;
  1727.            "All the message and browse systems have default mouse  support  which",;
  1728.            "you can augment by creating Mouse Hot Spots with the right associated",;
  1729.            "tw??HotSpot() or tw??MouseLine() functions. See TSDWIN.NG for more.",;
  1730.            "When you use Mouse Hot Spots, be sure to release the memory they  use",;
  1731.            "with the correct tw??RemHotSpot() or tw??LinePop() function.",;
  1732.            "In TSDWIN, the left button usually defaults to a 'Selection' key. For",;
  1733.            "instance, in a browse, pressing the left button on the current choice",;
  1734.            "will select it. The same holds for Alert Boxes.",;
  1735.            "Sometimes the left button is used for tagging, if multiple selections",;
  1736.            "are allowed. In browses in Edit mode, double clicking the left button",;
  1737.            "initiates an edit.",;
  1738.            "The right hand button usually defaults to the ESC key, except in case",;
  1739.            "of multiple choice selections again, where it is a selction key.",;
  1740.            "Scroll Bar arrows cause a line up or down with the left button and  a",;
  1741.            "page up or down with the right button. Both buttons take you  to  the",;
  1742.            "top or bottom of the browse. Clicking in the scroll  bars  themselves",;
  1743.            "moves the pointer proportionately." ;
  1744.             } )
  1745. IF AskUser( { "Continue with Demo", "EXIT to Main Menu" }, ;
  1746.               "The following demonstrates routines showing you " +;
  1747.               "how the low-level mouse functions work.." ) != 1
  1748.     RETURN NIL
  1749. ENDIF
  1750.  
  1751. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  1752. twTitle( PADC( "TSDWIN Low-Level Mouse Support", 30 ), TCOLOR, "T", "C" )
  1753. @ twRow( 03 ), twCol( 2 ) SAY "               FUNCTION                             0     1     2"
  1754. @ twRow( 04 ), twCol( 2 ) SAY "------------------------------------------------------------------"
  1755. @ twRow( 05 ), twCol( 2 ) SAY "                        Which Button Pressed  :"
  1756. @ twRow( 06 ), twCol( 2 ) SAY "                       X coordinate of Mouse  :"
  1757. @ twRow( 07 ), twCol( 2 ) SAY "                       Y coordinate of Mouse  :"
  1758. @ twRow( 08 ), twCol( 2 ) SAY "  Status of Button 0 Pressed ( 0, 1, 2,  3 )  :"
  1759. @ twRow( 09 ), twCol( 2 ) SAY "                    No. of Presses of Button  :"
  1760. @ twRow( 10 ), twCol( 2 ) SAY "     Get X coordinate of Last Button Pressed  :"
  1761. @ twRow( 11 ), twCol( 2 ) SAY "     Get Y coordinate of Last Button Pressed  :"
  1762. @ twRow( 12 ), twCol( 2 ) SAY "    Status of Button Released ( 0, 1, 2, 3 )  :"
  1763. @ twRow( 13 ), twCol( 2 ) SAY "                   No. of Releases of Button  :"
  1764. @ twRow( 14 ), twCol( 2 ) SAY "        X coordinate of Last Button Released  :"
  1765. @ twRow( 15 ), twCol( 2 ) SAY "        Y coordinate of Last Button Released  :"
  1766. @ twRow( 16 ), twCol( 2 ) SAY "               Horizontal Direction of Mouse  :"
  1767. @ twRow( 17 ), twCol( 2 ) SAY "                 Vertical Direction of Mouse  :"
  1768. @ twRow( 19 ), twCol( 2 ) SAY " Counter for Presses/Releases Display  ( 0-400 ):"
  1769. @ twRow( 20 ), twCol( 2 ) SAY "                       Seconds to Full Display:"
  1770.  
  1771. _twM1()
  1772.  
  1773. @ twRow( 21 ), twCol( 30 ) SAY "Press ESC or Click Here to QUIT" COLOR twEnhClr( SETCOLOR() )
  1774. DO WHILE INKEY() != 27
  1775.     nCount++
  1776.     IF SECONDS() - nTime >= 60
  1777.         lShowpresses := .T.
  1778.     ELSE
  1779.         @ twRow( 20 ), twCol( 50 ) SAY STR( 60 - ( SECONDS() - nTime ), 7, 2 )
  1780.     ENDIF
  1781.     @ twRow( 05 ), twCol( 50 ) SAY STR( _twM3B(), 5 ) //  Get Which Button Pressed
  1782.     @ twRow( 06 ), twCol( 50 ) SAY STR( _twM3C()   , 5 ) //  Get X coordinate of Mouse
  1783.     @ twRow( 07 ), twCol( 50 ) SAY STR( _twM3D()   , 5 ) //  Get Y coordinate of Mouse
  1784.     @ twRow( 08 ), twCol( 50 ) SAY STR( _twM5A( 0 ), 5 ) + " " + STR( _twM5A( 1 ), 5 ) + " " + STR( _twM5A( 2 ), 5 )  // <int M2>  Status of Button Pressed ( 0 = up, 1 = down )
  1785.     IF lShowPresses
  1786.         @ twRow( 10 ), twCol( 50 ) SAY STR( _twM5C( 0 ), 5 ) + " " + STR( _twM5C( 1 ), 5 ) + " " + STR( _twM5C( 2 ), 5 )  // <int M2>  Get X coordinate of Last Button Pressed
  1787.         @ twRow( 11 ), twCol( 50 ) SAY STR( _twM5D( 0 ), 5 ) + " " + STR( _twM5D( 1 ), 5 ) + " " + STR( _twM5D( 2 ), 5 )  // <int M2>  Get Y coordinate of Last Button Pressed
  1788.         @ twRow( 14 ), twCol( 50 ) SAY STR( _twM6C( 0 )  , 5 ) + " " + STR( _twM6C( 1 )  , 5 ) + " " + STR( _twM6C( 2 )  , 5 )  // <int M2>  Get X coordinate of Last Button Released
  1789.         @ twRow( 15 ), twCol( 50 ) SAY STR( _twM6D( 0 )  , 5 ) + " " + STR( _twM6D( 1 )  , 5 ) + " " + STR( _twM6D( 2 )  , 5 )  // <int M2>  Get Y coordinate of Last Button Released
  1790.         lShowPresses := .F.
  1791.     ENDIF
  1792.     @ twRow( 12 ), twCol( 50 ) SAY STR( _twM6A( 0 ), 5 ) + " " + STR( _twM6A( 1 ), 5 ) + " " + STR( _twM6A( 2 ), 5 )  // <int M2>  Status of Button Released ( 0 = up, 1 = down )
  1793.     @ twRow( 16 ), twCol( 50 ) SAY STR( _twM11C()   , 5 )  // Get Horizontal Direction of Mouse
  1794.     @ twRow( 17 ), twCol( 50 ) SAY STR( _twM11D()   , 5 )  // Get Vertical Direction of Mouse
  1795.     IF nCount = 400
  1796.         @ twRow( 09 ), twCol( 50 ) SAY STR( _twM5B( 0 ), 5 ) + " " + STR( _twM5B( 1 ), 5 ) + " " + STR( _twM5B( 2 ), 5 )  // <int M2>  No. of Presses of Button
  1797.         @ twRow( 13 ), twCol( 50 ) SAY STR( _twM6B( 0 )  , 5 ) + " " + STR( _twM6B( 1 )  , 5 ) + " " + STR( _twM6B( 2 )  , 5 )  // <int M2>  No. of Releases of Button
  1798.         nCount := 0
  1799.         lShowPresses := IIF( lShowPresses, .F., .T. )
  1800.     ENDIF
  1801.     @ twRow( 19 ), twCol( 50 ) SAY STR( nCount, 7 )
  1802.     nButton := twMGetPress( @nMRow, @nMCol )
  1803.     nMRow := INT( nMRow / 8 );nMCol := INT( nMCol / 8 )
  1804.  
  1805.     IF nMRow = 22 .AND. ( nMCol >= 30 .AND. nMCol <= 47 ) .AND. ( nButton == 1 )
  1806.         EXIT
  1807.     ENDIF
  1808. ENDDO
  1809.  
  1810. _twM2()
  1811. twPop()
  1812. RETURN NIL
  1813.  
  1814. //┌──────────────────────────────────────────────────────────────────────────┐
  1815. //│  Description: Miscellaneous Functions                                    │
  1816. //│       Author: Vic Lewis                                                  │
  1817. //│ Date created: 04-19-92                                                   │
  1818. //│ Time created: 06:45:03pm                                                 │
  1819. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1820. //├──────────────────────────────────────────────────────────────────────────┤
  1821. //│     Function: TSD70000                                                   │
  1822. //│                                                                          │
  1823. //│    Arguments: None                                                       │
  1824. //│                                                                          │
  1825. //│ Return Value: NIL                                                        │
  1826. //│                                                                          │
  1827. //└──────────────────────────────────────────────────────────────────────────┘
  1828. FUNCTION TSD70000()
  1829. LOCAL nKey, nGetTry := 0, GetList := {}, dGetTry := DATE()
  1830. LOCAL aNtxArray := {}, lMsgs := .F., nStartTime
  1831. LOCAL cFileSpec := "*.PRG,*.DOC        "
  1832. LOCAL cDest := "A:", cPath := ".\                  "
  1833. LOCAL wT := 3, wL := 10, wB := 15, wR := 70, cTitle := "Title String"
  1834. LOCAL cFooters := "Footer String"
  1835. LOCAL cMemo := "Printer Not Ready! You can try it if you want but it will not work."+;
  1836.         " Oh Well... I knew you had to go ahead and see for yourself. That really"+;
  1837.         " is a pity. Lack of trust will defeat us all, then that will be it! "+;
  1838.         "I wonder where it will all end. Probably at my own crucification!"+;
  1839.         " Whatever became of good old deceit and corporate skullduggery?"+;
  1840.         " I guess Santa ain't coming to town yet, eh?"
  1841. LOCAL tString
  1842. LOCAL mUdf, ActionKeys
  1843. LOCAL wColor, wSType, wFType, wFColor, lWrap, lEditMode, nLineLength
  1844. LOCAL nTabSize, nTBufRow, nTBufColumn
  1845. LOCAL nWinRow, nWinColumn, lScBar, lWindow
  1846.  
  1847. MEMVAR mDest
  1848.  
  1849. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  1850. twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
  1851. twTitle( PADC( 'TSD twCalculator()',  30 ), TCOLOR, 'T', 'C' )
  1852. twTitle( PADC( 'Shift-F1 to Call Calculator', 30 ), TCOLOR, 'B', 'C' )
  1853. twCalcInit( 2, 3, MAINCLC, 3, 10, .T. )
  1854. SET KEY K_SH_F1 TO twCallCalc()
  1855.  
  1856. DO WHILE .T.
  1857.     @ twRow( 4 ), twCol( 10 ) SAY "Get a Value:" GET nGetTry PICTURE "##########.####"
  1858.     twReadModal( GetList, .T. ); GetList := {}
  1859.  
  1860.     IF LASTKEY() == K_ESC
  1861.         EXIT
  1862.     ENDIF
  1863.  
  1864. ENDDO
  1865. twPop()
  1866.  
  1867. SET KEY K_SH_F1 TO
  1868. twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
  1869. twTitle( PADC( 'TSD twCalendar()', 30 ), TCOLOR, 'T', 'C' )
  1870.  
  1871. twDateInit( 2, 3, MAINCYN, 7, 10, .F. )
  1872.  
  1873. DO WHILE .T.
  1874.     @ twRow( 6 ), twCol( 10 ) SAY "Get a Date:" GET dGetTry PICTURE "@D" WHEN twCalendar( @dGetTry )
  1875.     twReadModal( GetList, .T. ); GetList := {}
  1876.  
  1877.     IF LASTKEY() == K_ESC
  1878.         EXIT
  1879.     ENDIF
  1880.  
  1881. ENDDO
  1882. twPop()
  1883. twCenter( 02, "The TSDWIN Indexer makes use of the new GaugeBar Class." )
  1884. twCenter( 03, "It gives your users what they want to see... what's" )
  1885. twCenter( 04, "going on... and frees you from the drudgery of creating" )
  1886. twCenter( 05, "needed but complex routines." )
  1887. twMInkeyWait( 1, .T., .T. )
  1888. twCenter( 07, "twIndexMaker Function Description" )
  1889. twMInkeyWait( 1, .T., .T. )
  1890. twSay( 09, 16, "Watch how these two lines of code operate:" )
  1891. twSay( 11, 6, "AADD( aNtxArray, { 'Windemo', 'Windemo', 'C', 'UPPER( CodeKey )' }) " )
  1892. twSay( 13, 6, "twIndexMaker( aNtxArray,,,,, COLORM, DSHADOW, D2FRAME, ; " )
  1893. twSay( 14, 16, "'Handy Index Maker',, .F. ) " )
  1894. twMInkeyWait( 1, .T., .T. )
  1895. twCenter( 22, " Press a Key or Button or Wait!! " )
  1896. twMInkeyWait( 5, .T., .T. )
  1897.  
  1898. AADD( aNtxArray, { "Windemo", "Windemo",   "C", "UPPER( CodeKey )" } )
  1899.  
  1900. twIndexMaker( aNtxArray,,,,, COLORM, DSHADOW, D2FRAME, ;
  1901.                "Handy Index Maker",, .F. )
  1902. twCenter( 16, "How was That??" )
  1903. twMInkeyWait( 1, .T., .T. )
  1904. twClear( .F. )
  1905.  
  1906. twTitle( PADC( "twBackUp() Demonstration",  30  ), TCOLOR, "T", "C" )
  1907. DO WHILE .T.
  1908.     @ twRow( 2 ), twCol( 10 ) SAY "       Path:" GET cPath PICTURE "@!@S25"
  1909.     @ twRow( 4 ), twCol( 10 ) SAY "   FileSpec:" GET cFileSpec PICTURE "@!"
  1910.     @ twRow( 6 ), twCol( 10 ) SAY "Destination:" GET cDest PICTURE "@!"
  1911.     @ twRow( 8 ), twCol( 10 ) SAY "Messages:" GET lMsgs PICTURE "Y"
  1912.     twReadModal( GetList ); GetList := {}
  1913.     IF LASTKEY() == K_ESC
  1914.         EXIT
  1915.     ENDIF
  1916.     nStartTime := SECONDS()
  1917.     twBackUp( cPath, cFileSpec, cDest, lMsgs, COLORM, DSHADOW, D2FRAME, COLORFM )
  1918.     UserMsg( "Backup Took: " + ALLTRIM( STR( (SECONDS() - nStartTime)/60 )) + " Minutes" )
  1919.  
  1920.     MEMVAR->mDest := cDest +  "*.*"
  1921.     ERASE &mDest
  1922. ENDDO
  1923. RELEASE mDest
  1924.  
  1925. twTitle( PADC( "Memo Handling Demonstration",  30  ), TCOLOR, "T", "C" )
  1926. twClear( .F. )
  1927. lMsgs      := .T.
  1928. lEditMode  := .T.
  1929. nWinColumn := NIL
  1930. lScBar     := .T.
  1931. lWindow    := .T.
  1932. nLineLength := 100
  1933. cTitle      := "Testing twMemoEdit()"
  1934.  
  1935. cMemo := cMemo + cMemo + cMemo + cMemo + cMemo
  1936.  
  1937. cMemo := twMemoEdit( wT, wL, wB, wR, cMemo, cTitle, cFooters, mUdf, ActionKeys, ;
  1938.                      COLORM, DSHADOW, DFRAME, COLORFM, .T., lEditMode, .T., ;
  1939.                      nLineLength, nTabSize, nTBufRow, nTBufColumn, ;
  1940.                      nWinRow, nWinColumn, lScBar, lWindow )
  1941.  
  1942. twMemoView( wT, wL, wB, wR, cMemo, "Testing twMemoView()", cFooters, ;
  1943.             COLORM, DSHADOW, DFRAME, COLORFM )
  1944.  
  1945. twPop()
  1946. RETURN NIL
  1947.  
  1948. //┌──────────────────────────────────────────────────────────────────────────┐
  1949. //│  Description: TSDWIN Hardware Functions                                  │
  1950. //│       Author: Vic Lewis                                                  │
  1951. //│ Date created: 04-19-92                                                   │
  1952. //│ Time created: 07:39:52pm                                                 │
  1953. //│    Copyright: Trilateral Systems Development Ltd.                        │
  1954. //├──────────────────────────────────────────────────────────────────────────┤
  1955. //│     Function: TSD80000                                                   │
  1956. //│                                                                          │
  1957. //│    Arguments: None                                                       │
  1958. //│                                                                          │
  1959. //│ Return Value: NIL                                                        │
  1960. //│                                                                          │
  1961. //└──────────────────────────────────────────────────────────────────────────┘
  1962. FUNCTION TSD80000()
  1963. LOCAL nKey := 0, aKeyTry := {}, nX := 0, nRow := 3
  1964. LOCAL cDrStat := "0", nDrive := 0, GetList := {}, RetVal
  1965.  
  1966. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  1967. twTitle( "twIsDrive()Demonstration", TCOLOR )
  1968. twTitle( "Get out a Diskette or Two!!!!!!!!!!!!!",, "B", "C" )
  1969. BEEPER
  1970. DO WHILE .T.
  1971.     twSay( 2, 5, "Enter Drive to Check ( 0 for Drive A:, 1 for Drive B: )!" )
  1972.     @ twRow( 4 ), twCol( 12 ) GET nDrive PICTURE "#"
  1973.     twReadModal( GetList ); GetList := {}
  1974.     IF LASTKEY() == K_ESC
  1975.         EXIT
  1976.     ENDIF
  1977.  
  1978.     twIsDrive( nDrive, 3, 4 )
  1979.  
  1980. ENDDO
  1981. twPop()
  1982.  
  1983. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  1984. twTitle( "Testing tw_GetKSt() - Try the Keys!!!", TCOLOR )
  1985. AADD( aKeyTry, RSHIFT        )
  1986. AADD( aKeyTry, LSHIFT        )
  1987. AADD( aKeyTry, CTRL          )
  1988. AADD( aKeyTry, ALT           )
  1989. AADD( aKeyTry, SCROLLSTAT    )
  1990. AADD( aKeyTry, NUMLOCKSTAT   )
  1991. AADD( aKeyTry, CAPLOCKSTAT   )
  1992. AADD( aKeyTry, INSERTSTAT    )
  1993. AADD( aKeyTry, CTRLNUMLKSTAT )
  1994. AADD( aKeyTry, SCROLLOCK     )
  1995. AADD( aKeyTry, NUMLOCK       )
  1996. AADD( aKeyTry, CAPLOCK       )
  1997. AADD( aKeyTry, INSERT        )
  1998. twSay( nRow++, 15, "        Right Shift:")
  1999. twSay( nRow++, 15, "         Left Shift:")
  2000. twSay( nRow++, 15, "            Control:")
  2001. twSay( nRow++, 15, "          Alternate:")
  2002. twSay( nRow++, 15, " Scroll Lock Status:")
  2003. twSay( nRow++, 15, "Number Lock Status :")
  2004. twSay( nRow++, 15, "   Caps Lock Status:")
  2005. twSay( nRow++, 15, "      Insert Status:")
  2006. twSay( nRow++, 15, "Ctrl NumLock Status:")
  2007. twSay( nRow++, 15, "    Scroll Lock Key:")
  2008. twSay( nRow++, 15, "    Number Lock Key:")
  2009. twSay( nRow++, 15, "      Caps Lock Key:")
  2010. twSay( nRow++, 15, "         Insert Key:")
  2011.  
  2012. DO WHILE ( nkey := Inkey()) != 27
  2013.     twTitle( "Counter" + STRINT( ++nX ), "", "B", "C" )
  2014.     nRow := 3
  2015.     twSay( nRow++, 35, STR( tw_GetKSt( RSHIFT        )), ;
  2016.         IIF( tw_GetKSt( RSHIFT )= 0,;
  2017.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2018.     twSay( nRow++, 35, STR( tw_GetKSt( LSHIFT        )), ;
  2019.         IIF( tw_GetKSt( LSHIFT )= 0,;
  2020.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2021.     twSay( nRow++, 35, STR( tw_GetKSt( CTRL          )), ;
  2022.         IIF( tw_GetKSt( CTRL )= 0,;
  2023.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2024.     twSay( nRow++, 35, STR( tw_GetKSt( ALT           )), ;
  2025.         IIF( tw_GetKSt( ALT )= 0,;
  2026.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2027.     twSay( nRow++, 35, STR( tw_GetKSt( SCROLLSTAT    )), ;
  2028.         IIF( tw_GetKSt( SCROLLSTAT )= 0,;
  2029.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2030.     twSay( nRow++, 35, STR( tw_GetKSt( NUMLOCKSTAT   )), ;
  2031.         IIF( tw_GetKSt( NUMLOCKSTAT )= 0,;
  2032.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2033.     twSay( nRow++, 35, STR( tw_GetKSt( CAPLOCKSTAT   )), ;
  2034.         IIF( tw_GetKSt( CAPLOCKSTAT )= 0,;
  2035.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2036.     twSay( nRow++, 35, STR( tw_GetKSt( INSERTSTAT    )), ;
  2037.         IIF( tw_GetKSt( INSERTSTAT )= 0,;
  2038.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2039.     twSay( nRow++, 35, STR( tw_GetKSt( CTRLNUMLKSTAT )), ;
  2040.         IIF( tw_GetKSt( CTRLNUMLKSTAT )= 0,;
  2041.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2042.     twSay( nRow++, 35, STR( tw_GetKSt( SCROLLOCK     )), ;
  2043.         IIF( tw_GetKSt( SCROLLOCK )= 0,;
  2044.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2045.     twSay( nRow++, 35, STR( tw_GetKSt( NUMLOCK       )), ;
  2046.         IIF( tw_GetKSt( NUMLOCK )= 0,;
  2047.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2048.     twSay( nRow++, 35, STR( tw_GetKSt( CAPLOCK       )), ;
  2049.         IIF( tw_GetKSt( CAPLOCK )= 0,;
  2050.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2051.     twSay( nRow++, 35, STR( tw_GetKSt( INSERT        )), ;
  2052.         IIF( tw_GetKSt( INSERT )= 0,;
  2053.         twStdClr( SETCOLOR()),twEnhClr( SETCOLOR())))
  2054. ENDDO
  2055. twMInkeyWait( 3, .T., .T. )
  2056. twPop()
  2057.  
  2058. RETURN NIL
  2059.  
  2060. //┌──────────────────────────────────────────────────────────────────────────┐
  2061. //│  Description: Place an Order                                             │
  2062. //│       Author: Vic Lewis                                                  │
  2063. //│ Date created: 04-19-92                                                   │
  2064. //│ Time created: 07:54:56pm                                                 │
  2065. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2066. //├──────────────────────────────────────────────────────────────────────────┤
  2067. //│     Function: TSD9000                                                    │
  2068. //│                                                                          │
  2069. //│    Arguments: None                                                       │
  2070. //│                                                                          │
  2071. //│ Return Value: NIL                                                        │
  2072. //│                                                                          │
  2073. //└──────────────────────────────────────────────────────────────────────────┘
  2074. FUNCTION TSD90000()
  2075. LOCAL nWin1
  2076. nWin1 := twOpen( FULLSCREEN, COLORW, DSHADOW, DFRAME,, COLORFW )
  2077. twOpen( 16, 65, 22, 78, WHH_CYN )
  2078. twSay( 00, 0, " ▄▄▄▄▄▄▄▄▄▄▄▄▄ ", RDH_CYN )
  2079. twSay( 01, 0, " ▀     █     ▀ ", RDH_CYN )
  2080. twSay( 02, 0, "       █       ", RDH_CYN )
  2081. twSay( 03, 0, "       █       ", RDH_CYN )
  2082. twSay( 04, 0, "       █       ", RDH_CYN )
  2083. twSay( 05, 0, "       █       ", RDH_CYN )
  2084. twSay( 06, 0, "       █       ", RDH_CYN )
  2085. twSay( 07, 0, "      ▄█▄      ", RDH_CYN )
  2086. twSlide( "U", 13 )
  2087. twSlide( "L", 61 )
  2088. twOpen( 15, 64, 22, 77, WHH_CYN )
  2089. twSay( 00, 0, "▄▄▄▄▄▄▄▄▄▄▄▄▄▄", YEL_CYN )
  2090. twSay( 01, 0, "█            █", YEL_CYN )
  2091. twSay( 02, 0, "█            █", YEL_CYN )
  2092. twSay( 03, 0, "█             ", YEL_CYN )
  2093. twSay( 04, 0, "▀▀▀▀▀▀▀▀▀▀▀▀▀█", YEL_CYN )
  2094. twSay( 05, 0, "             █", YEL_CYN )
  2095. twSay( 06, 0, "█            █", YEL_CYN )
  2096. twSay( 07, 0, "█            █", YEL_CYN )
  2097. twSay( 08, 0, "█▄▄▄▄▄▄▄▄▄▄▄▄█", YEL_CYN )
  2098. twSlide( "U", 7 )
  2099. twSlide( "L", 60 )
  2100. SETCOLOR( YEL_CYN )
  2101. @5 + 3, 4 say "▄▄▄▄▄▄▄█▄▄▄▄▄▄"
  2102. @6 + 3, 4 say "█     ▄█▄    █"
  2103. SETCOLOR( RDH_CYN )
  2104. @5 + 3, 11 say "█"
  2105. @6 + 3, 10 say "▄█▄"
  2106. twOpen( 16, 65, 22, 78, WHH_CYN )
  2107. twSay( 00, 0, "  ▄▄▄▄▄▄▄▄▄▄  ", WHH_CYN )
  2108. twSay( 01, 0, "  ██       █  ", WHH_CYN )
  2109. twSay( 02, 0, "  ██       █  ", WHH_CYN )
  2110. twSay( 03, 0, "  ██       █  ", WHH_CYN )
  2111. twSay( 04, 0, "  ██       █  ", WHH_CYN )
  2112. twSay( 05, 0, "  ██       █  ", WHH_CYN )
  2113. twSay( 06, 0, "  ██▄▄▄▄▄▄▄█  ", WHH_CYN )
  2114. twSlide( "U", 02 )
  2115. twSlide( "L", 61 )
  2116. SETCOLOR( YEL_CYN )
  2117. @11 + 3, 4 say "█ ▄▄▄▄▄▄▄▄▄▄ █"
  2118. @12 + 3, 4 say "█▄██▄▄▄▄▄▄▄█▄█"
  2119. SETCOLOR( WHH_CYN )
  2120. @11 + 3, 6 say "▄▄▄▄▄▄▄▄▄▄"
  2121. @12 + 3, 6 say "██"
  2122. @12 + 3, 15 say "█"
  2123. _twHandle( nWin1 )
  2124. twSay( 15 + 2, 20, "█   █ ▀█▀ █▄▄▄" )
  2125. twSay( 16 + 2, 20, "█ █ █  █  █  █" )
  2126. twSay( 17 + 2, 20, "█▄█▄█ ▄█▄ █  █         CLIPPER 5.01 Windowing Library" )
  2127. twMInkeyWait( .5, .T., .T. )
  2128. twCenter( 21, "VISA - MasterCard - American Express - Discover", GNH_CYN )
  2129.  
  2130. twHLine( 01, 21, 56, 1, BLH_CYN )
  2131.  
  2132. twSay( 02, 21, "TSDWIN.LIB v1.50 is a ShareWare Product. You are free to", RED_CYN )
  2133. twSay( 03, 21, "use it in order  to judge its  usefulness to you in your", RED_CYN )
  2134. twSay( 04, 21, "   situation. If you like and continue to  use TSDWIN, ", RED_CYN )
  2135. twSay( 05, 21, "          please register one of these options:", RED_CYN )
  2136. twSay( 07, 29, "1. Register Your Version 1.50 $ 75.00 US" )
  2137. twSay( 09, 29, "2. Latest Version/Part Source $115.00 US" )
  2138. twSay( 11, 29, "3. Latest Version/Full Source $185.00 US" )
  2139. twSay( 13, 29, "All include your Disk Format with Manual" )
  2140. twSay( 14, 29, "and NG on disk. Support BBS membership." )
  2141. twSay( 15, 29, "See ORDERFRM.DOC for Details." )
  2142. twSay( 17, 36, "TSDWIN's customers are the most important", BLA_CYN )
  2143. twSay( 18, 36, "      factor in its evolving design!", BLA_CYN )
  2144. twMInkeyWait( 3, .T., .T. )
  2145. _twHandle( nWin1 )
  2146. twTitle( "Any Key or Button", TCOLOR, "B", "C" )
  2147. twMInkeyWait( 30, .T., .T. )
  2148. twSay( 17, 36, "                                         ", BLA_CYN )
  2149. twSay( 18, 36, "  Here's where you can place your order!", RED_CYN )
  2150. twMInkeyWait( 3, .T., .T. )
  2151. twScroll( 15, .F., 1, 21, 16, 77 )
  2152. twMInkeyWait( 1, .T., .T. )
  2153. twSay( 02, 21, "          CANADA              U.S.A. -  Central/West   " , RED_CYN )
  2154. twSay( 03, 21, "       TSD Limited             FOX Business Systems    " , WHH_CYN )
  2155. twSay( 04, 21, "     18 Bond St. South             217 McCall Rd.      " , BLA_CYN )
  2156. twSay( 05, 21, "    Dundas, ON,  Canada        Manhattan, KS,  66502   " , BLA_CYN )
  2157. twSay( 06, 21, "          L9H 3H1               Voice: 913-776-1452    " , BLA_CYN )
  2158. twSay( 07, 21, "    Voice: 416-628-5086           BBS: 913-776-0111    " , BLA_CYN )
  2159. twSay( 08, 21, "      BBS: 519-650-0389                                " , BLA_CYN )
  2160.  
  2161. twSay( 10, 21, "       U.S.A -  East                   EUROPE          " , RED_CYN )
  2162. twSay( 11, 21, "     Ahlstedt Software       Meisal SoftWare Production" , WHH_CYN )
  2163. twSay( 12, 21, "  2212 Wade Hampton Blvd.            Torgvegen 17      " , BLA_CYN )
  2164. twSay( 13, 21, "Greenville, SC, 29615-2249      Kleppe, Norway, N4060  " , BLA_CYN )
  2165. twSay( 14, 21, "    Voice: 803-292-2249           Voice: +474-425625   " , BLA_CYN )
  2166. twSay( 15, 21, "                                         +474-627555   " , BLA_CYN )
  2167.  
  2168. twTitle( "Press a Key or Button to Exit or Wait", TCOLOR, "B", "C" )
  2169. twMInkeyWait( 30, .T., .T. )
  2170. _twHandle( LEN( _twStack()))
  2171. twPop();twPop();twPop();twPop()
  2172. RETURN NIL
  2173.  
  2174. //┌──────────────────────────────────────────────────────────────────────────┐
  2175. //│  Description: Black Box for twButtonBox()                                │
  2176. //│       Author: Vic Lewis                                                  │
  2177. //│ Date created: 04-18-92                                                   │
  2178. //│ Time created: 10:02:25am                                                 │
  2179. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2180. //├──────────────────────────────────────────────────────────────────────────┤
  2181. //│     Function: AskUser                                                    │
  2182. //│                                                                          │
  2183. //│    Arguments: aChoices  - array of prompts                               │
  2184. //│               cQuestion - prompt string                                  │
  2185. //│               cTitle    - optional title for window                      │
  2186. //│                                                                          │
  2187. //│                                                                          │
  2188. //│ Return Value: Choice number or zero on K_ESC.                            │
  2189. //│                                                                          │
  2190. //└──────────────────────────────────────────────────────────────────────────┘
  2191. FUNCTION AskUser( aChoices, cQuestion, cTitle )
  2192. LOCAL nRetVal, nRowAdd
  2193. LOCAL nWinWidth := 0, nLeft, nRight, x := 0
  2194. DEFAULT aChoices TO { "Yes", "No" },;
  2195.         cQuestion TO "Proceed?",;
  2196.         cTitle TO NIL
  2197.  
  2198. AEVAL( aChoices, {|x| nWinWidth += ( LEN( x ) + 4 ) } )
  2199.  
  2200. nWinWidth += 3
  2201. nLeft   := INT( ( MAXCOL() / 2 ) - ( nWinWidth / 2 ))
  2202. nRight  := INT( ( MAXCOL() / 2 ) + ( nWinWidth / 2 ))
  2203. nRowAdd := INT( LEN( cQuestion ) / ( nRight - nLeft ))
  2204.  
  2205. RETURN ( twButtonBox( "H", cQuestion, cTitle,, aChoices,, 6, nLeft, ;
  2206.                 12 + nRowAdd, nRight, DSHADOW, DFRAME ))
  2207.  
  2208. //┌──────────────────────────────────────────────────────────────────────────┐
  2209. //│  Description: Informative Message Black Box                              │
  2210. //│       Author: Vic Lewis                                                  │
  2211. //│ Date created: 04-18-92                                                   │
  2212. //│ Time created: 01:01:50pm                                                 │
  2213. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2214. //├──────────────────────────────────────────────────────────────────────────┤
  2215. //│     Function: UserMsg                                                    │
  2216. //│                                                                          │
  2217. //│    Arguments: nT, nB   - Coordinates to start the box                    │
  2218. //│               xMessage - Display string or array                         │
  2219. //│               nWait    - Wait Time                                       │
  2220. //│                                                                          │
  2221. //│ Return Value:                                                            │
  2222. //│                                                                          │
  2223. //└──────────────────────────────────────────────────────────────────────────┘
  2224. FUNCTION UserMsg( xMessage, nWait, nT, nB )
  2225. RETURN twInfo( xMessage,, nWait, nT, nB, DSHADOW, DFRAME )
  2226.  
  2227. //┌──────────────────────────────────────────────────────────────────────────┐
  2228. //│  Description: Window Activation Routines                                 │
  2229. //│       Author: Vic Lewis                                                  │
  2230. //│ Date created: 04-18-92                                                   │
  2231. //│ Time created: 08:07:18pm                                                 │
  2232. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2233. //├──────────────────────────────────────────────────────────────────────────┤
  2234. //│    Procedure: Window                                                     │
  2235. //│                                                                          │
  2236. //│    Arguments: nHandle - Handle of window to activate.                    │
  2237. //│                                                                          │
  2238. //└──────────────────────────────────────────────────────────────────────────┘
  2239. PROCEDURE Window( nHandle )
  2240. STATIC nRow1 :=  0, nRow2 :=  0, nRow3 :=  0, nRow4 :=  0
  2241. LOCAL nRow, lOk := .T., GetList := {}
  2242. DO CASE
  2243.     CASE nHandle = 4
  2244.         nRow1 := IIF( nRow1 > 6, 1, nRow1 + 1 ); nRow := nRow1
  2245.     CASE nHandle = 5
  2246.         nRow2 := IIF( nRow2 > 6, 1, nRow2 + 1 ); nRow := nRow2
  2247.     CASE nHandle = 6
  2248.         nRow3 := IIF( nRow3 > 6, 1, nRow3 + 1 ); nRow := nRow3
  2249.     CASE nHandle = 7
  2250.         nRow4 := IIF( nRow4 > 6, 1, nRow4 + 1 ); nRow := nRow4
  2251. ENDCASE
  2252. twActivate( nHandle )
  2253. IF nRow = 1
  2254.     twClear( .F. )
  2255. ENDIF
  2256. tw_Say2( twRow( nRow + 1 ), twCol( 1 + nRow ), "Activation «" + ALLTRIM( STR( nRow )) + "»", twVattr( twStdClr( _twColor())), twVattr( twEnhClr( _twColor())))
  2257. @ twRow( nRow ), twCol( 27 ) SAY "OK?" GET lOk PICTURE "Y"
  2258. twReadModal( GetList, .T. )
  2259. RETURN
  2260.  
  2261. //┌──────────────────────────────────────────────────────────────────────────┐
  2262. //│  Description: Store the menu descriptions.                               │
  2263. //│       Author: Vic Lewis                                                  │
  2264. //│ Date created: 04-18-92                                                   │
  2265. //│ Time created: 09:59:19am                                                 │
  2266. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2267. //├──────────────────────────────────────────────────────────────────────────┤
  2268. //│     Function: StoreDesc                                                  │
  2269. //│                                                                          │
  2270. //│    Arguments: nX - Message to return                                     │
  2271. //│                                                                          │
  2272. //│ Return Value: Message array                                              │
  2273. //│                                                                          │
  2274. //└──────────────────────────────────────────────────────────────────────────┘
  2275. FUNCTION StoreDesc( nX )
  2276. LOCAL aMessages := {}
  2277.  
  2278. AADD( aMessages, {"One of the most powerful features of «TSDWIN»", ;
  2279.                   "is its ability to operate on any  window in", ;
  2280.                   "the stack.  You  can «write to either active»", ;
  2281.                   "«or inactive windows».","", ;
  2282.                   "All the other features let you  design YOUR", ;
  2283.                   "interface the way YOU want it.  «TSDWIN» does", ;
  2284.                   "not interfere with  «your personal style»  of", ;
  2285.                   "interface design.","", ;
  2286.                   "«TSDWIN» is a granular library.  ONLY modules", ;
  2287.                   "you need are linked.  We have respect for a", ;
  2288.                   "need to  conserve  memory and have designed", ;
  2289.                   "«TSDWIN» accordingly!", "", ;
  2290.                   "Your continued  support is  appreciated and", ;
  2291.                   "helps to make this the product YOU want."} )
  2292.  
  2293. AADD( aMessages, {"«TSDWIN» lets  you configure  your windows to", ;
  2294.                   "match your own personal interface style. We", ;
  2295.                   "offer:", ;
  2296.                   "         ∙ Multiple «frame» types.", ;
  2297.                   "         ∙ Multiple «shadow» types.", ;
  2298.                   "         ∙ «Lines» and «Boxes».", ;
  2299.                   "         ∙ Various «title» schemes.", ;
  2300.                   "         ∙ Window «reactivation».", ;
  2301.                   "         ∙ Varied «text formatting».", ;
  2302.                   "         ∙ «Browses» and «Picklists».", ;
  2303.                   "         ∙ «Menus» and «Messages».", ;
  2304.                   "         ∙ Easy «Mouse Support».", ;
  2305.                   "         ∙ Comprehensive «documentation».", ;
  2306.                   "         ∙ «Calculator» and «Calendar».", ;
  2307.                   "         ∙ «Moving», «Sizing» and «Sliding»",;
  2308.                   "         ∙ «BBS» and voice «support»." ;
  2309.                   } )
  2310.  
  2311. AADD( aMessages, {"«TSDWIN» offers three message systems:", ;
  2312.                   "", ;
  2313.                   "   ∙ Windowed informative and warning", ;
  2314.                   "     messages with automatic formatting.", ;
  2315.                   "   ∙ «Line» or «Area» messages with the", ;
  2316.                   "     option to use embedded colours.", ;
  2317.                   "   ∙ Three types of «Alert» boxes using", ;
  2318.                   "", ;
  2319.                   "           «Pushbutton»", ;
  2320.                   "           «Checkmark»", ;
  2321.                   "           and «Radio» selection.", ;
  2322.                   "", ;
  2323.                   "   ∙ Optional «ActionKeys».", ;
  2324.                   "   ∙ Automatic «Mouse Support».", ;
  2325.                   "   ∙ Initialization schemes to ensure", ;
  2326.                   "     consistency.", ;
  2327.                   "   ∙ On-the-Fly control of defaults." ;
  2328.                   } )
  2329.  
  2330. AADD( aMessages, {"«TSDWIN»'s MENU TO  replacement gives you the", ;
  2331.                   "option to «control colours». It also includes", ;
  2332.                   "automatic  «hot keys»  and  «Mouse Support».", ;
  2333.                   "", ;
  2334.                   "There  are three  types  of «message systems»", ;
  2335.                   "including  multi-line messages  with direct", ;
  2336.                   "screen writes for speed. This menu is using", ;
  2337.                   "multi-line messages.", ;
  2338.                   "", ;
  2339.                   "Menus  may include «security» and also «action", ;
  2340.                   "blocks» to execute external code.", ;
  2341.                   "", ;
  2342.                   "Windowed «PopUp» menus  are available in both", ;
  2343.                   "the MENU TO and ACHOICE() format.", ;
  2344.                   "", ;
  2345.                   "An  expandable «Line Menu»  accepts a varying", ;
  2346.                   "number of prompts." } )
  2347.  
  2348. AADD( aMessages, {"«TSDWIN» offers a choice of fast «DBF» and «Array»", ;
  2349.                   "browsers, with or without «Mouse Support».", ;
  2350.                   "", ;
  2351.                   "The new browses in «TSDWIN» 1.50  give you the", ;
  2352.                   "most complete control of column  definitions", ;
  2353.                   "and on-the-fly modification methods you will", ;
  2354.                   "find available.", ;
  2355.                   "", ;
  2356.                   "«Append» and «Edit» modes are availables in both", ;
  2357.                   "DBF and Array browses.", ;
  2358.                   "", ;
  2359.                   "«ActionKeys» and «Mouse Hot Spots»  make it very", ;
  2360.                   "easy to construct comprehensive mouse driven",;
  2361.                   "modules.", ;
  2362.                   "", ;
  2363.                   "You can build  whole applications around the", ;
  2364.                   "new browses in «TSDWIN» V1.50." ;
  2365.                   } )
  2366.  
  2367. AADD( aMessages, {"Mouse support in «TSDWIN» is almost automatic.", ;
  2368.                   "", ;
  2369.                   "With the  exception  of «Mouse Hot Spots», one", ;
  2370.                   "call to «twMouseInit()» at the  beginning of a", ;
  2371.                   "program  provides  you  with «automatic» mouse", ;
  2372.                   "operations.", ;
  2373.                   "", ;
  2374.                   "There  are «High and Level» mouse functions to", ;
  2375.                   "allow  you to extend and customize the mouse", ;
  2376.                   "operations already available in «TSDWIN».", ;
  2377.                   "", ;
  2378.                   "Two  methods of handling «Mouse Hot Spots» are", ;
  2379.                   "included:  one based on information  held in", ;
  2380.                   "the  calling  routine and another managed by", ;
  2381.                   "«TSDWIN».", ;
  2382.                   "", ;
  2383.                   "Mousing is «FUN» with «TSDWIN»."} )
  2384.  
  2385. AADD( aMessages, {"«TSDWIN» offers many functions which allow you", ;
  2386.                   "to provide your «clients» with  little  extras", ;
  2387.                   "to keep them «coming back».", ;
  2388.                   "", ;
  2389.                   "We  provide a  comprehensive «Calculator» with", ;
  2390.                   "memory  and a «Calendar» system to  use either", ;
  2391.                   "for data entry or as a driver for other date", ;
  2392.                   "operations.", ;
  2393.                   "", ;
  2394.                   "Creating «indexes» is easy and informative for", ;
  2395.                   "your clients when you use twIndexMaker().", ;
  2396.                   "", ;
  2397.                   "«File Backup» is available  with this version,", ;
  2398.                   "with or without the interface we provide.", ;
  2399.                   "", ;
  2400.                   "You will find replacements for MEMOEDIT()." ;
  2401.                   } )
  2402.  
  2403. AADD( aMessages, {"«TSDWIN» offers some functions  which directly", ;
  2404.                   "affect the computer hardware.", ;
  2405.                   "", ;
  2406.                   "We believe this area to be well-supported in",;
  2407.                   "other third party products and so our thrust",;
  2408.                   "is to provide only functions  which directly",;
  2409.                   "affect the «user interface».",;
  2410.                   "",;
  2411.                   "We offer easy and complete disk «Drive Status»",;
  2412.                   "checks which you can  call  Low-Level or use",;
  2413.                   "our windowed interface.", ;
  2414.                   "", ;
  2415.                   "There is the ability to check and/or set the", ;
  2416.                   "status of 'dead' keys (CTRL ALT DEL etc.).", ;
  2417.                   "", ;
  2418.                   "An on-screen «Clock» can be called directly or", ;
  2419.                   "fitted into your window scheme by «TSDWIN»." ;
  2420.                   } )
  2421.  
  2422. AADD( aMessages, {"", ;
  2423.                   "", ;
  2424.                   "", ;
  2425.                   "You can order «TSDWIN» V1.50 several ways with",;
  2426.                   "several  options. «Next day» shipment can  now", ;
  2427.                   "be guaranteed. The author of «TSDWIN» has made", ;
  2428.                   "venture agreements with people to look after", ;
  2429.                   "product distribution.", ;
  2430.                   "", ;
  2431.                   "«ALL» current registered  users will receive a", ;
  2432.                   "«free upgrade» to TSDWIN V1.50  automatically.", ;
  2433.                   "The upgrade  will be at their «original level»", ;
  2434.                   "of registration." ;
  2435.                   } )
  2436.  
  2437. AADD( aMessages, {"", ;
  2438.                   "", ;
  2439.                   "", ;
  2440.                   "",;
  2441.                   "     Trilateral Systems Development Ltd.",;
  2442.                   "",;
  2443.                   "has enjoyed bringing you this demonstration.";
  2444.                   } )
  2445.  
  2446. RETURN aMessages[ nX ]
  2447.  
  2448. //┌──────────────────────────────────────────────────────────────────────────┐
  2449. //│  Description: Display Corporate Colours                                  │
  2450. //│       Author: Vic Lewis                                                  │
  2451. //│ Date created: 04-18-92                                                   │
  2452. //│ Time created: 02:00:01pm                                                 │
  2453. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2454. //├──────────────────────────────────────────────────────────────────────────┤
  2455. //│     Function: TSDSetup                                                   │
  2456. //│                                                                          │
  2457. //│    Arguments: lMono                                                      │
  2458. //│                                                                          │
  2459. //│ Return Value: NIL                                                        │
  2460. //│                                                                          │
  2461. //└──────────────────────────────────────────────────────────────────────────┘
  2462. FUNCTION TSDSetup( lMono )
  2463. IF ! lMono
  2464.     @ 0, 19 SAY "T" COLOR "r+/bg"
  2465.     @ 0, 20 SAY "S" COLOR "gr+/bg"
  2466.     @ 0, 21 SAY "D" COLOR "w+/bg"
  2467. ENDIF
  2468. IF ! lMono
  2469.     @ MAXROW(), 22 SAY "T" COLOR "r+/bg"
  2470.     @ MAXROW(), 33 SAY "S" COLOR "gr+/bg"
  2471.     @ MAXROW(), 41 SAY "D" COLOR "w+/bg"
  2472. ENDIF
  2473.  
  2474. RETURN NIL
  2475.  
  2476. //┌──────────────────────────────────────────────────────────────────────────┐
  2477. //│  Description: GetReader for twBRBrowse() Demo                            │
  2478. //│       Author: Vic Lewis                                                  │
  2479. //│ Date created: 04-19-92                                                   │
  2480. //│ Time created: 05:46:50pm                                                 │
  2481. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2482. //├──────────────────────────────────────────────────────────────────────────┤
  2483. //│    Procedure: BRGetReader                                                │
  2484. //│                                                                          │
  2485. //│    Arguments: get - Get Object                                           │
  2486. //│               lGoRight - stuff a oDB:Right()                             │
  2487. //│               lRightOnEnter - stuff a oDB:Right() and write get          │
  2488. //│     See Also:                                                            │
  2489. //│                                                                          │
  2490. //└──────────────────────────────────────────────────────────────────────────┘
  2491. PROCEDURE BRGetReader( get, lGoRight, lRightOnEnter )
  2492. DEFAULT lGoRight TO .T., ;
  2493.         lRightOnEnter TO .F.
  2494. // read the GET IF the WHEN condition is satisfied
  2495. IF ( GetPreValidate( get ))
  2496.     // activate the GET for reading
  2497.     get:SetFocus()
  2498.     DO WHILE ( get:exitState == GE_NOEXIT )
  2499.  
  2500.         // check for initial typeout ( no editable positions )
  2501.         IF ( get:typeOut )
  2502.             get:exitState := GE_ENTER
  2503.         ENDIF
  2504.  
  2505.         // apply keystrokes until exit
  2506.         DO WHILE ( get:exitState == GE_NOEXIT )
  2507.             BRGetApplyKey( get, INKEY( 0 ), lGoRight, lRightOnEnter )
  2508.         ENDDO
  2509.  
  2510.         // disallow exit IF the VALID condition is not satisfied
  2511.         IF ( !GetPostValidate( get ))
  2512.             get:exitState := GE_NOEXIT
  2513.         ENDIF
  2514.     ENDDO
  2515.     // de-activate the GET
  2516.     get:KillFocus()
  2517. ENDIF
  2518. RETURN
  2519.  
  2520. //┌──────────────────────────────────────────────────────────────────────────┐
  2521. //│  Description: Custom GET Key Handler for Parts Browse (twBRBrowse() )    │
  2522. //│       Author: Vic Lewis                                                  │
  2523. //│ Date created: 04-19-92                                                   │
  2524. //│ Time created: 05:49:33pm                                                 │
  2525. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2526. //├──────────────────────────────────────────────────────────────────────────┤
  2527. //│    Procedure: BRGetApplyKey                                              │
  2528. //│                                                                          │
  2529. //│    Arguments: get - Get Object                                           │
  2530. //│               key - key passed from get reader                           │
  2531. //│               lGoRight - stuff a oDB:Right()                             │
  2532. //│               lRightOnEnter - stuff a oDB:Right() and write get          │
  2533. //│                                                                          │
  2534. //└──────────────────────────────────────────────────────────────────────────┘
  2535. PROCEDURE BRGetApplyKey( get, key, lGoRight, lRightOnEnter )
  2536. LOCAL cKey
  2537. LOCAL bKeyBlock
  2538. // check for SET KEY first
  2539. IF (( bKeyBlock := SETKEY( key )) <> NIL )
  2540.     GetDoSetKey( bKeyBlock, get )
  2541.     RETURN                                  // NOTE
  2542. ENDIF
  2543.  
  2544. DO CASE
  2545.     CASE ( key == K_UP )
  2546.         get:exitState := GE_UP
  2547.  
  2548.     CASE ( key == K_SH_TAB )
  2549.         get:exitState := GE_UP
  2550.  
  2551.     CASE ( key == K_DOWN )
  2552.         get:exitState := GE_DOWN
  2553.  
  2554.     CASE ( key == K_TAB )
  2555.         get:exitState := GE_DOWN
  2556.  
  2557.     CASE ( key == K_ENTER )
  2558.         IF lGoRight
  2559.             get:exitState := GE_ENTER
  2560.             IF lRightOnEnter
  2561.                 __keyboard( CHR( K_RIGHT ))
  2562.             ENDIF
  2563.         ELSE
  2564.             IF lRightOnEnter
  2565.                 get:exitState := GE_WRITE
  2566.                 __keyboard( CHR( K_RIGHT ))
  2567.             ELSE
  2568.                 get:exitState := GE_WRITE
  2569.                 __keyboard( CHR( K_CTRL_HOME ) + IIF( !( RECNO() = LASTREC() + 1 ), CHR( K_DOWN ), "" ))
  2570.             ENDIF
  2571.         ENDIF
  2572.  
  2573.     CASE ( key == K_ESC )
  2574.         IF ( SET( _SET_ESCAPE ))
  2575.             get:undo()
  2576.             get:exitState := GE_ESCAPE
  2577.         ENDIF
  2578.  
  2579.     CASE ( key == K_PGUP )
  2580.         get:exitState := GE_WRITE
  2581.  
  2582.     CASE ( key == K_PGDN )
  2583.         get:exitState := GE_WRITE
  2584.  
  2585.     CASE ( key == K_CTRL_HOME )
  2586.         get:exitState := GE_TOP
  2587.  
  2588.         #ifdef CTRL_END_SPECIAL
  2589.         // both ^W and ^End go to the last GET
  2590.     CASE ( key == K_CTRL_END )
  2591.         get:exitState := GE_BOTTOM
  2592.  
  2593.         #ELSE
  2594.         // both ^W and ^End terminate the READ ( the default )
  2595.     CASE ( key == K_CTRL_W )
  2596.         get:exitState := GE_WRITE
  2597.         #ENDIF
  2598.  
  2599.     CASE ( key == K_INS )
  2600.         SET( _SET_INSERT, !SET( _SET_INSERT ))
  2601.         BRShowScoreboard()
  2602.  
  2603.     CASE ( key == K_UNDO )
  2604.         get:Undo()
  2605.  
  2606.     CASE ( key == K_HOME )
  2607.         get:Home()
  2608.  
  2609.     CASE ( key == K_END )
  2610.         get:End()
  2611.  
  2612.     CASE ( key == K_RIGHT )
  2613.         //get:Right()
  2614.         get:exitState := GE_WRITE
  2615.         IF lGoRight
  2616.             __keyboard( CHR( K_RIGHT ))
  2617.         ELSE
  2618.             __keyboard( CHR( K_CTRL_HOME ) + IIF( !( RECNO() = LASTREC() + 1 ), CHR( K_DOWN ), "" ))
  2619.         ENDIF
  2620.  
  2621.     CASE ( key == K_LEFT )
  2622.         //get:Left()
  2623.         get:exitState := GE_WRITE
  2624.         __keyboard( CHR( K_LEFT ))
  2625.  
  2626.     CASE ( key == K_CTRL_RIGHT )
  2627.         get:Right()
  2628.  
  2629.     CASE ( key == K_CTRL_LEFT )
  2630.         get:Left()
  2631.  
  2632.     CASE ( key == K_BS )
  2633.         get:BackSpace()
  2634.  
  2635.     CASE ( key == K_DEL )
  2636.         get:Delete()
  2637.  
  2638.     CASE ( key == K_CTRL_T )
  2639.         get:DelWordRight()
  2640.  
  2641.     CASE ( key == K_CTRL_Y )
  2642.         get:DelEnd()
  2643.  
  2644.     CASE ( key == K_CTRL_BS )
  2645.         get:DelWordLeft()
  2646.  
  2647.     OTHERWISE
  2648.  
  2649.         IF ( key >= 32 .AND. key <= 255 )
  2650.             cKey := CHR( key )
  2651.             IF ( get:type == "N" .AND. ( cKey == "." .OR. cKey == ", " ))
  2652.                 get:ToDecPos()
  2653.             ELSE
  2654.                 IF ( SET( _SET_INSERT ))
  2655.                     get:Insert( cKey )
  2656.                 ELSE
  2657.                     get:Overstrike( cKey )
  2658.                 ENDIF
  2659.                 IF ( get:typeOut .AND. !SET( _SET_CONFIRM ))
  2660.                     IF ( SET( _SET_BELL ))
  2661.                         ?? CHR( 7 )
  2662.                     ENDIF
  2663.                     IF lGoRight
  2664.                         get:exitState := GE_ENTER
  2665.                         IF lRightOnEnter
  2666.                             __keyboard( CHR( K_RIGHT ))
  2667.                         ENDIF
  2668.                     ELSE
  2669.                         get:exitState := GE_WRITE
  2670.                         __keyboard( CHR( K_CTRL_HOME ) + IIF( !( RECNO() = LASTREC() + 1 ), CHR( K_DOWN ), "" ))
  2671.                     ENDIF
  2672.                 ENDIF
  2673.             ENDIF
  2674.         ENDIF
  2675. ENDCASE
  2676. RETURN
  2677.  
  2678. /**********************************
  2679. *
  2680. *   wacky compatibility services
  2681. *
  2682. */
  2683. // display coordinates for SCOREBOARD
  2684. #define SCORE_ROW       0
  2685. #define SCORE_COL       60
  2686.  
  2687. //┌──────────────────────────────────────────────────────────────────────────┐
  2688. //│  Description: Compatibility PROC  for get reader                         │
  2689. //│       Author: Vic Lewis                                                  │
  2690. //│ Date created: 04-19-92                                                   │
  2691. //│ Time created: 05:51:35pm                                                 │
  2692. //│    Copyright: Trilateral Systems Development Ltd.                        │
  2693. //├──────────────────────────────────────────────────────────────────────────┤
  2694. //│    Procedure: BRShowScoreBoard                                           │
  2695. //│                                                                          │
  2696. //│    Arguments: None                                                       │
  2697. //│                                                                          │
  2698. //└──────────────────────────────────────────────────────────────────────────┘
  2699. STATIC PROCEDURE BRShowScoreboard()
  2700. LOCAL nRow, nCol
  2701. IF ( SET( _SET_SCOREBOARD ))
  2702.     nRow := ROW()
  2703.     nCol := COL()
  2704.     SETPOS( SCORE_ROW, SCORE_COL )
  2705.     DISPOUT( IIF( SET( _SET_INSERT ), "Ins", "   " ))
  2706.     SETPOS( nRow, nCol )
  2707. ENDIF
  2708. RETURN
  2709.